Setting JAVA_HOME for portable eclipse

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:36:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!