| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| = DevFaqSpecifyJdkVersion |
| :jbake-type: wiki |
| :jbake-tags: wiki, devfaq, needsreview |
| :jbake-status: published |
| :keywords: Apache NetBeans wiki DevFaqSpecifyJdkVersion |
| :description: Apache NetBeans wiki DevFaqSpecifyJdkVersion |
| :toc: left |
| :toc-title: |
| :syntax: true |
| |
| == My module requires JDK 6; how do I keep it from being loaded in JDK 5? |
| |
| Add a line to your manifest, specifying which version of Java you need. E.g. to only run on JDK 6 and higher, not 5: |
| |
| [source,java] |
| ---- |
| |
| OpenIDE-Module-Java-Dependencies: Java > 1.6 |
| ---- |
| |
| Note that `>` really means `>=`, and that the traditional "internal" version numbers like "1.5", "1.6", etc. must be used despite the new Java naming scheme (JDK 5, JDK 6, ...). |
| |
| Requesting 5+ is pointless since no recent version of NetBeans runs on JDK 1.4 anyway. |
| |
| There is also a syntax for requesting a particular version of the virtual machine |
| (as opposed to Java platform APIs) but this is seldom if ever used. |
| |
| By default, your module will depend on the same Java version as you specify for `javac.source`, |
| i.e. the version of the Java language your module requires. |
| |
| The NetBeans module development support permits you to pick a JDK to use for compiling |
| (and running) a module or suite. |
| Obviously you must specify a JDK at least as new as what your dependency requests; |
| it is unwise to specify a newer JDK than that: |
| you might accidentally use some newer APIs without realizing it, |
| making your code not actually run on the declared minimum version. |
| |
| |
| Applies to: NetBeans 6.x |
| |
| Platforms: all |
| |
| === Apache Migration Information |
| |
| The content in this page was kindly donated by Oracle Corp. to the |
| Apache Software Foundation. |
| |
| This page was exported from link:http://wiki.netbeans.org/DevFaqSpecifyJdkVersion[http://wiki.netbeans.org/DevFaqSpecifyJdkVersion] , |
| that was last modified by NetBeans user Admin |
| on 2009-11-06T16:00:17Z. |
| |
| |
| *NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed. |