Search

Categories

Links

Referers

NetBeans and Mustang

Apr 27 2005, 02:25:19 AM PDT »NetBeans Comments [2]
Have you tried running NetBeans using the latest Mustang builds from java.net? You might have noticed that it really doesn't work. That's because NetBeans has chosen to use the JDK version for the -source option to javac. This is probably a good idea for shipped releases, but for the Mustang snapshots, it isn't really what you want. Using -source 6 (which is otherwise a noop) enables -target 6 by default. However, that target is currently being developed. Until recently, the JVM didn't even accept the class file version, now it does, however the compiler is not following the spec yet.

So don't start using -source 6 yet in NetBeans. Right click on your project, open properties, and add -source 5 in the Build/Compiling section.

UPDATE: As of NetBeans 4.1 RC2 (not beta) you can now set a source level. I just installed NetBeans using a Mustang runtime and I think the default was to use source level 1.5. To set the source level, open the project properties as described above and use the pull down menu:

screenshot of netbeans

Anyways, javac and JVM should soon be agreeing on -target 6. So in a few weeks you can start trying out the new stack map format which should improve security as we can enable the verifier by default.

Post a Comment:
Comments are closed for this entry.
Comments:

I'm trying to add the -source 1.5 to get past the compiler error of "generics are not supported in source 1.3" However, the instructions in this blog state: "Right click on your project, open properties, and add -source 5 in the Build/Compiling section." I right-click on my project (in Netbeans 4.1), then I select Build->Compile. I don't see a place to add -source 5. I only see these options: Javac Options: (they're all checkboxes)
  1. Generate Debugging Information
  2. Compile with optimization
  3. Report Uses of Deprecated APIs
Then there's a text box for the encoding: Encoding: ISO-8859-1 I'm a java newbie, and I'd appreciate you telling me exactly where to add the phrase "-source 5" Thanks, jdl

Posted by jdl on November 03, 2005 at 11:24 AM PST #

Petr Hrebejk said:

The right place to ask questions about the IDE is the nbusers@netbeans.org. You can subscribe to the list at: http://www.netbeans.org/community/lists/top.html

Anyway your current problem is that you run the IDE on the 1.3 and you did not explicitly specify a Java Platform. To do so:
1) Go to Main menu -> Tools -> Java Platform Manager, add choose Add platform and point the IDE to the directory where you have the 1.5 installed
2) Go to Properties of you project, choose Libraries node and choose the 1.5 platform in the Platform combo box (on top of the panel)
3) Now go to sources node and set the source combo to 1.5

Posted by Peter von der Ahé on November 06, 2005 at 02:41 PM PST #

Java is a trademark of Sun Microsystems, Inc.
Copyright © 2006,2007 Peter von der Ahé