How to change default JRE for all Eclipse workspaces?

后端 未结 11 2111
囚心锁ツ
囚心锁ツ 2020-12-05 09:30

I have one JRE in C:\\Program Files (x86)\\Java\\jre6 and that was the only one at the time I installed Eclipse. I have subsequently installed a complete JDK i

11条回答
  •  青春惊慌失措
    2020-12-05 10:26

    My answer will overlap with amphibient's while adding on to it.

    Your JAVA_HOME variable is fine, but you also need to append the following to your Path variable :

    ;%JAVA_HOME%\bin
    

    This will allow your applications in your Windows environment to access your JDK. You should also restart your computer once you've added these environment variables before checking out if they work. In my case, even logging out and then back in didn't work : I had to completely restart.

    If you want to check if the environment variables are set correctly, you can open up a command prompt and type >echo %JAVA_HOME and >echo %Path% to see if those variables are working correctly. While snooping around for solutions, I have also run into people claiming that they need to add quotations marks (") around the environment variables to make them work correctly ("%JAVA_HOME%"\bin) if your JAVA_HOME path includes spaces. I thought that this was my case at first, but after doing a full restart my variables seemed to work correctly without quotation marks despite the spaces.

提交回复
热议问题