my dog learned polymorphism*
The moose likes IDEs, Version Control and other tools and the fly likes how to force compiler to use particular version of java in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "how to force compiler to use particular version of java in eclipse" Watch "how to force compiler to use particular version of java in eclipse" New topic
Author

how to force compiler to use particular version of java in eclipse

Amruta nikam
Greenhorn

Joined: Sep 28, 2013
Posts: 20

someone please tell me how to force compiler to use particular version of java while running code.....currently i have Java7 on my computer....and i am preparing for scjp 6 exam....so for this i want to run my code as java6 version....i know how to do it in command prompt (javac -source 6 ClassName.java)...no idea how to give this source 6 flag in eclipse IDE....Please please help me....
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10171
    
    8

Eclipse->Preferences->Java->Installed JREs
Of course you will need to install JDK1.6 before you use the above to point to it.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

You don't need to install JDK 6. Instead, just go to Window > Preferences > Java > Compiler and in set "Java compliance level" to 1.6


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to force compiler to use particular version of java in eclipse
 
Similar Threads
checking eclipse version
Getting error: Bad version number in .class file
Eclipse vs NetBeans
can i use Java7 for scjp6 exam?
newbie needs direction