简体   繁体   中英

Getting eclipse to use Java 1.7

I'm running Mac OS X 10.9.1 (Mavericks). I was having a problem getting eclipse kepler to recognize Java 1.7 (u45), which I installed from the Oracle site. System Preferences clearly pointed to this version but eclipse couldn't find it.

I reinstalled Mavericks then installed the latest version of Java (051) from Oracle. Then started kepler and got the following popup:

在此处输入图片说明

After searching for a solution and not finding one, I tried a backup version of eclipse: juno. Now I get his popup:

在此处输入图片说明

Which takes me to Apple software update, which runs successfully.

Now juno starts ok but with kepler, I get:

在此处输入图片说明

And I'm back where I started.

How do I get out of this loop?

My first guess is that installing the Apple Java messed up the Oracle installation. Try reinstalling that one. Secondly you probably need to get Eclipse to use Oracle's JDK at startup. You can do that from the command line using the "-vm" parameter or patch the JDK's Info.plist as described in this post Eclipse Kepler for OS X Mavericks request Java SE 6 .

So I went for the nuclear option. I trashed kepler and got a fresh download. Then installed the Google jdks and plugin. Eclipse now recognized my java 1.7 install and Google plugin happily deploys my code.

I'm glad to be back up an running but disappointed that I didn't learn what went wrong in the first place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM