Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Amruta nikam
Greenhorn
Posts: 22
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse->Preferences->Java->Installed JREs
Of course you will need to install JDK1.6 before you use the above to point to it.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic