问题
I am running Windows XP. I have a portable eclipse installed on a usb and when I tried installing the Android SDK it said "Java SE Development kit (JDK) not found" and told me to set the JAVA_HOME environment variable. The Java SDK is located in
K:\EclipsePortable\JDK\bin K:\EclipsePortable\JRE\bin K:\EclipsePortable\JDK\jre\bin K:\EclipsePortable\App\Eclipse\JRE\bin
I am using K:\EclipsePortable\JDK\ so I assume I set it to one of those two paths. How do i do this? Is this in eclipse or a Windows thing?
回答1:
An environment variable is for the operating system. As you are on Windows XP - follow these steps to set up a JAVA_HOME environment variable:
Click "Start" -> "Control Panel" and open "System". Choose "Advanced" tab and click on the "Environment Variables" button. In the "System Variables" section, add a new one named JAVA_HOME and put the value to your Java JDK directory (K:\EclipsePortable\JDK)
Alternatively you can press the Windows + Pause/Break key combination which will bring up the "System Properties" window straight away, then you can go from there.
回答2:
If you want to add a portable jdk with it, you need to tune up the eclipse.ini file. To do this add
-vm K:\EclipsePortable\JDK\bin\javaw.exe
as shown below
. . --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vm K:\EclipsePortable\JDK\bin\javaw.exe --launcher.appendVmargs -vmargs . .
来源:https://stackoverflow.com/questions/11237078/setting-java-home-for-portable-eclipse