• Post Reply Bookmark Topic Watch Topic
  • New Topic

What to do in Eclipse after updating JDK  RSS feed

 
Kyle Bishop
Greenhorn
Posts: 9
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I recently updated my JDK, and I updated the JRE in Eclipse via Window->Preferences->Java->installed JRE's by setting the new JDK as my default. However, when I deleted the old JDK from my computer, Eclipse wouldn't start because it couldn't find the JRE pointed to by the file path of the old JRE. I tried changing a few things int the environment variables, but it kept doing the same thing until I just restored the old JDK from my recycle bin. My question is: when you update your JDK, do you just leave your old ones in place to prevent errors like this? If so, is there a reason why? If not, what do I need to do so that Eclipse will look for the new JDK and be able to open?

I hope my questions are clear. Please tell me if further clarification is needed. Thanks!
 
Carey Brown
Saloon Keeper
Posts: 3310
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What operating system are you using?
In windows you need to configure two environment variables: JAVA_HOME, and PATH. Ideally you will use %JAVA_HOME%\bin inside your PATH so that in the future you'll only have to change JAVA_HOME.
 
Kyle Bishop
Greenhorn
Posts: 9
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:What operating system are you using?
In windows you need to configure two environment variables: JAVA_HOME, and PATH. Ideally you will use %JAVA_HOME%\bin inside your PATH so that in the future you'll only have to change JAVA_HOME.


Thanks for the quick reply! I thought I had my environment variables correct, but that may not be the case. Eclipse still won't open without the old JDK present. Here's what my variables look like now:

JAVA_HOME: C:\Program Files\Java\jdk1.8.0_74
Path: C:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;;C:\Users\username\adb; %JAVA_HOME%\bin

Does anything there stand out as being incorrect? Any tips or corrections appreciated!
 
Carey Brown
Saloon Keeper
Posts: 3310
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you open up a command window and enter "java -version", what do you get?
 
Kyle Bishop
Greenhorn
Posts: 9
Chrome Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:If you open up a command window and enter "java -version", what do you get?


Here's what I get:
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)



EDIT: Okay, I've solved it. I found the eclipse configuration file and changed the path for the virtual machine. Now it opens just fine! Thanks for your help!
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In future, put the PATH to your Java® installation at the start of the PATH. Otherwise if there is another java.exe in the PATH, that java.exe will be found first. There is now a risk that the java.exe will be older than the javac.exe, which will cause problems running your code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!