java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4100
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
Setting Target JDK E-mail
User Rating: / 1
PoorBest 

You'll use this tip if you want the NetBeans to produce compiled .class files in a version that is lower than the JDK you're running. That can be useful for instance if the customer you're writing code for is using an older version of Java. You can still use JDK 5 as your development platform, but by setting the source level you specify the Java version for compiler.

How to do it? You can specify the target JDK by right-clicking the Libraries node in Projects View and choosing Properties. Then, go to Sources section and the Source Level combobox is what you are looking for. You can choose source level 1.2, 1.3, 1.4 or 1.5 if your platform is JDK 5. Here is a screenshot:

Setting Target JDK in NetBeans

If you set for instance the source level to 1.4, the compiler won't accept all the new JDK 5 features like varargs, generics, autoboxing, enhanced for loop, etc. These are all marked as errors. When you compile your project, all classes are created with the source level you specify in here.

Source: Roumen's Weblog


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.