2

I do plan to check the API and make sure that I am only using jdk6 libraries but a couple of compatibility posts on here have made me a bit nervous.

I need to upload some files onto a jdk6 computer but I run eclipse with jdk7 on mine and I do not have time to check if the files will compile. I need them to be able to compile. Is there something I can do to avoid trouble?

0

2 Answers 2

2

Use -target key for java 1.7 compiler to make sure your code will run on jvm 6 flawlessly.

1

In eclipse, use the JDK compliance property. Right click on a project, Java Compiler -> Compiler compliance level -> 1.6

2
  • In eclipse, use the JDK compliance property. Right click on a project, Java Compiler -> Compiler compliance level -> 1.6 and that is it? I don't need to install jdk6? That is a relief. I won't be able to say whether it works or not yet though so I hope you are right!
    – Magpie
    Commented Aug 17, 2012 at 14:13
  • Yes that's it. Internally, this will set the -target argument of the javac executable to 1.6.
    – aymeric
    Commented Aug 17, 2012 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.