Changing Java for projects
by, 11-14-2011 at 06:37 PM (1022 Views)
Sometimes you want to keep legacy code and for that you have to use older version of Java. These days, people are working in Java 5 and Java 6. But still developers are using legacy code which means using Java 1.3 and Java 1.4. In this post, I will brief you how to change the Java version for projects in Eclipse.
Eclipse provides support for changing the Java version through few clicks. Eclipse 3.3.0 has Java 5.0 configured. So if you do not specify Java version, your project will be compiled with Java 5.0 by default.
Suppose you have legacy code written in Java 1.4 and you want to open, edit and run in Eclipse. Of course, Eclipse includes JDK 1.4 as well. But you have to configure it for your project. Lets see how to do it:
Right click the project from package Explorer and then click properties. Properties popup window will open.
By default, “Enable project specific settings” won’t be checked. Check it and then choose the compiler from the dropdown.
Now simply click ok. All is set now.
Happy codding :)