Thursday, December 5, 2013

Issues with the JDK, Eclipse Galileo and PATH Environment variable

Problems with the JDK and Eclipse:
"JDK Not found...." & "JNI Error..."
I had quite a lot of trouble fixing my Java JDK and Eclipse Galileo IDE. Thing was that I was trying to reuse my old installation of Eclipse (which being portable does not require a setup/installation) with the old JDK 1.6.0 Setup, I had saved. My old eclipse started throwing up strange problems when I tried working on new projects in my old workspace, even though the previous projects and files were working fine with the IDE.
I decided on updating my Java which gave me a new JRE 1.7 which existed with JDK 1.6.0 (Creating more path related confusions). This created more hassles with my system when I tried installing a new version of Eclipse IDE Kepler. The IDE started throwing "JDK not found" errors and my command prompt (Yes, I'm still stuck with Windows 7. I will build a dual boot with Linux Mint, as soon as I get the download finished.) also did not respond to "java" or "java -version" commands. So, I figured out that my JDK has been screwed.
Ineffective Solution:Capture
I tried all the fixes available from altering the "eclipse.ini" configuration file shipped with eclipse to point to my JDK using "-vm %JAVA_HOME%"\bin\" and other similar combinations. Then the system started throwing JNI Error of a missing .dll file from the jre in the client folder. One way was to link to its path the location in the configuration file (Messy! Don't do that! Well, unless you know what you're doing).
Solution:
Uninstalled and Reinstalled Java (JDK 1.7). [My suggestion; You should try CCleaner after uninstalls to clean and fix Windows Registry.] Set the PATH environment variable from:Capture 2
Advanced System Settings (From My Computer Properties after Right Clicking) > System Properties (Dialog) > Advanced (Tab) > Environment Variables (Button) > System Variables (Window) > New/Edit (Button below the window depending whether "path" or "PATH" variable exists or not) > Adding the path/address to "%JAVA_HOME%\bin". Then you may need to restart the system.
Capture3  Capture4Capture5
I downloaded the download available from Oracle with the latest Netbeans IDE bundled together. [Link] (For the JDK only try this Link.)
Did You Know: There are different JDKs available to use. They have the same standard libraries but, they also have special libraries bundled with them to be compatible with the other vendor services and tools. The two giants IBM and Oracle, there are Open Source versions too, like the one from GNU and OpenJDK; Courtesy of Sun Microsystems, which had released the Source Code as open source sometime, back in 2006.
Conclusion: My JDK, Eclipse Kepler and NetBeans IDE works like magic.
Other known Reasons for similar JDK and Eclipse Problems are incompatible softwares, like using 64 Bit JDK or IDE on a 32 Bit System. Here is a small note on it:
Working: 32 Bit OS + 32 Bit JDK + 32 Bit Eclipse IDE
Working: 64 Bit OS + 32 Bit JDK + 32 Bit Eclipse IDE
Working: 64 Bit OS + 64 Bit JDK + 64 Bit Eclipse IDE

No comments:

Post a Comment