Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
428 views
in Technique[技术] by (71.8m points)

android - More eclipse insanity. Wrong JDK is set on imported projects

Maybe its just me but almost everytime I import an Android project it does not compile. First I need to set the Android SDK. Thats reasonable. But then, I almost always need to reset the JDK. Usually from JDK 1.4 to JDK 1.6. Now I really don't think too many people are out there developing android with JDK 1.4. Perhaps they are, but its no where on my machine, and yet its often pre-selected on every Android project I import. Its an annoying extra step, and I cannot imagine xCode doing something like this. Does anyone know why Eclipse does this?

Now some of these projects are not the most recent. But what makes me think this is an eclipse issue is that often the error is that it won't compile because its not version 1.6 Which means that it must have been developed with the JDK 1.6. Its usually an error involving @Override that I see saying it can't be used without JDK 1.5 or 1.6+. I then check the JDK setting for the project and sure enough its at JDK 1.4. Never 1.5, Never 1.3.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Set the project's JRE to an Execution Environment. It's an extra layer of indirection that keeps you from referencing a JRE by its name in your particular workspace, helping make the project more easily shared.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...