Vaibhav's Blog Space

Weekend with registry and JDK :)

Thursday May 15, 2008

Last weekend, I was trying to find out all the JDK installed in my machine and its path(JAVA_HOME) as well. Just want to see that shall I control all JDK from one place. Most of time it happens with me, I need to check my code on several JDK and finally everything messed up. Setting JAVA_HOME, setting PATH and many more.

So, I see if I get to know the path of java and javac of all JDK versions, I can compile it and even run it from a single location. Solaris and Linux sounds similar in this case but the problem was to find it on Windows. Off course, checking some registry entries of installation and finally I wrote a small code which can tell you all the JDK version and PATH of it on your local machine. From here, you can download the jar file from  HERE (for windows)and if you want the code, please let me know. Now, need to move further and work on my problem of various JDK version.

Surprisingly joke happened with my friend, when I was given him this jar file. He told me I have only JDK 1.5.0_14 on my machine and I am not using any other because this is the most stable version of JDK(I don't know on which basis, he was making that conclusion). He ran my jar file and came up with 2 versions of JDK 1.3, 1 version of JDK1.4.2, 3 version of JDK 1.5 and 1 version of JDK 1.6. Oh God, I am wasting so much of space :)).

 

[7] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg
Comments:

Cool.But when I run it on my Windows2003, exception occurs.

I am in Exception
java.lang.ArrayIndexOutOfBoundsException: 2
at JDKPlace.getJDKInfo(JDKPlace.java:77)
at UICode.main(UICode.java:23)

Posted by Katsumi INOUE on May 16, 2008 at 07:48 AM IST #

Cool this is going to help ! If possible can you please pass me the registry information of JDK installed on your machine. I have seen one of my friend is also getting this error on Win2003 only, so i will fix it as soon as possible.

Posted by Vaibhav Choudhary on May 16, 2008 at 08:27 AM IST #

Vaibhav, I'll mail you my registry info.

Posted by Katsumi INOUE on May 18, 2008 at 08:57 AM IST #

Thanks much.

Posted by Vaibhav on May 18, 2008 at 09:04 AM IST #

Here is the new jar file:

http://blogs.sun.com/vaibhav/resource/JDK/JDKPath.jar

Thanks for your help Katsumi INOUE !

Posted by Vaibhav Choudhary on May 20, 2008 at 10:20 AM IST #

Thanks , it worked.

Posted by Katsumi INOUE on May 20, 2008 at 10:35 AM IST #

Cool, thanks ! you helped me to fix a bad bug. There is problem in tokens, windows other machines are not handling registry value in the same way as 2k3 do, wired !.

Posted by Vaibhav Choudhary on May 20, 2008 at 12:36 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed