开发者

Can I use Java 7 with Eclipse 3.x?

I 开发者_如何转开发am trying to config my eclipse (Helios) use jdk 7 to compile my code. I didn't install jdk 7 on my Windows XP. But I include all of the jdk contents with my project. It seems the solution provided in this post doesn't work. Compile java code needs JDK. the JRE is enough for running the compiled code. I think we need a way to configure the JDK to be used not just JRE. I tested with a JDK 7 new feature, String in switch, I can compile it in my batch file compile system but cannot use eclipse to compile it.

any idea?


This is what I did to make Eclipse 3.x works with Java 7.

  1. install Java 7 in another machine and then copy the JDK folder into my java application 3rdparty directory (so my machine still use Java 6);

  2. download the Eclipse 3.7.1 from here: eclipse 3.7.1

  3. configure Eclipse by following steps in this post (select 1.7 in Compiler compliance level under the Java Compiler entry);

At least I can use String in Switch now in Eclipse.

Good luck.


Compile java code needs JDK. the JRE is enough for running the compiled code.

  • that is right

"But I include all of the jdk contents with my project"

  • Including those will not change eclipse's compiler behavior. Including files under project build path just makes those classes available for your application development/run-time (or as good as setting CLASSPATH)

Do these :

1 - Install required version of JDK

2 - Choose following menu - Window > Preferences > Java > Compiler - and you will see a drop down to choose the version you want to use.

3 - Read this and this as well.

Good luck for being DBA after 5 yrs. Please consider working on your English as well (no offense please)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜