March 23, 2009

How do I know if I have Sun Java Development Kit installed?

It normally happens that we need to check if JDK is installed on our system.

You can check it in a couple of ways as explained below:

For Windows:
  • If you are on windows and the kit was installed using the standard JDK installer you can find it in "Control Panel > Add Remove Programs".
  • Also check for directories in the windows installation drive. I am assuming its C:. The location can be C:\jdk.....<version>or c:\program files\java\<java version> this folder can also contain JRE, so check the folder name, if its prefixed/suffixed with jre, then its not the right one.
  • Other option is to see if environment var JAVA_HOME is set. For this just hit echo %JAVA_HOME% on command prompt. This will tell you the Java install dir.
  • In case nothing was found on JAVA_HOME var, you can also echo %PATH% variable to see, if its having java in it i.e. PATH variable points to the java bin folder having executables like java, javac, jar. So in case you find any thing on it. This will take you to java install dir.
  • If you have not installed using installer i.e. you have unzipped it. Then simplest is to do file search for java, javac etc. The folder holding these files will point you either to JRE or JDK
For Linux
  • If installed using some installer or linux tool like apt-get or yum then hit on shell $ whereis java it should show you available folders having java installed. for ex  /usr/bin/java /etc/java /usr/share/java
  • other wise just do a file search for javac, it should help like windows.