开发者

Compile java 1.5 compatible applications under NetBeans IDE 6.9.1

开发者 https://www.devze.com 2023-02-17 09:54 出处:网络
I\'m using NetBeans IDE 6.9.1 for developing java/javafx applets, this netbeans version generates only java 1.6 compatible applets开发者_如何学运维. But there is needed to make applets launchable on m

I'm using NetBeans IDE 6.9.1 for developing java/javafx applets, this netbeans version generates only java 1.6 compatible applets开发者_如何学运维. But there is needed to make applets launchable on mac_os 10.5 (where default version of jvm is 1.5). I've tried to find how may I change compile options, but had no success. Could anybody help to solve this problem?


Have a look in the project properties, there you can set the source / binary format to the version you need. But note that this will not hide methods that are only available in the Java platform version which is set in your IDE (which will most likely be 1.6 these days). This can be problematic for example with the IOException constructor accepting a cause, and other API extensions which were introduced with Java 1.6 or later.

Netbeans will happily compile this code when set to 1.5, but it will indeed not run on a 1.5 JVM. So to be absolutely sure you will also have to install a 1.5 JDK, add it to your platforms list (Tools -> Platforms) and use that to compile your project. As an additional bonus, when using the right JDK NetBeans will mark things like the missing IOException constructor right in the editor window.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号