How do I get a JRE file for Eclipse?
Background: In my Mac OSX 10.6 Snow Leopard, I've downloaded the Eclipse and Android SDKs. I started on a Hello World tutorial provided by Eclipse, but a dialog insists it can't find a JRE.
After a bit of searching the web, I learned that it should be in the eclipse/jre/ folder, but that folder does not exist on my system. I downloaded the Java for Mac OSX 10.6 package from the Apple Developer site, and still see no jre files.
Supposedly it is should be provided by Java. No use writing the file in eclipse.ini if I can't find the file in the first place.
This page indicates that the Max OS X already has the JRE, but I can't find the file to开发者_StackOverflow中文版 link to it: http://www.eclipse.org/downloads/moreinfo/jre.php
I have installed Android, Eclipse, ADT, AVD, PhoneGap.
Summary: Need JRE.
Try /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Alternatively check /System/Library/Frameworks/JavaVM.framework/Versions/ for other versions.
For Mac OS X VMs there should be Home at the end of the location.
You should be able to download the OS X version of Eclipse, unpack it, and start the Eclipse.app executable and then be able to write runnable Java programs as Java is available by default in OS X.
If you cannot start Eclipse.app, then my guess would be that you downloaded the wrong version of Eclipse. Be certain it is the 32-bit version offered on the http://eclipse.org/downloads/ page as it should run on all 10.6 machines.
If you can start Eclipse.app, and you can type in programs, but you cannot run them, please take a screen dump of your Eclipse -> Preferences page placed on the Java->Installed JRE's panel.
From your post it sounds like you can launch Eclipse ok?
If you can launch Eclipse you have a working JRE.
Eclipse picks up the JRE from your system, or if it finds nothing it looks for a jre folder in the same directory as the Eclipse executable.
So it sounds like your JRE is somewhere on your system (otherwise Eclipse wouldn't start), but for some reason you do not have any pre-defined in the Installed JRE preference page. Here's how you can find the JRE eclipse is using to bootstrap, and set it up as one to use:
In Eclipse 3.6.1:
Have a look in Help->About Eclipse SDK
Click "Installation Details"
Go to the Configuration tab
There should be a reference to the JRE in there - e.g. on mine: -vm ~/personal dev/jdk1.6.0_24/bin/../jre/lib/i386/client/libjvm.so
Once you've found that, open up Windows->Preferences->Java->Installed JREs and add a new one to point to the location you found (eg on mine it is ~/Desktop/personal dev/jdk1.6.0_24)
精彩评论