How to check JDK version that installed on your computer

Here’s a quick guide to show the use of “java -version” command to check the current JDK version that installed on your computer.

1. Open your command prompt in Wndows or terminal in *nix.
2. Type “java -version“.

C:\>java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

In this case, JDK “1.6.0_18” is installed on the computer.

Reference

  1. Java version history
Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • swap

    thanks a lot ….. :) can we have more than one jdk running at the same time ? what is difference between jdk , jre , jinitiator , jvm ??? ple elaborate in simple manner..

  • swap

    thanks a lot ….. :) can we have more than one jdk running at the same time ? what is difference between jdk , jre , jinitiator , jvm ??? ple elaborate in simple manner.

  • Steve Witham

    The title of this post says, “How to find the JDK version,” but recent JDK versions are like 6 or 7. Once I find the “1.x.y” version number, am I supposed to just strip off the “1.” part?

  • Paulami

    Thanks it helped

  • vijay

    thank you

  • Pandarinath

    Thanks dear for simple solution. It helped.
    Regards
    SP

  • Vittorio

    wrong. that gives you the version of the JRE in your path.
    if you want to have the JDK version you have to go to the jre/bin folder in your JDK and run the local file java version.

    Linux example:

    get the java version in my PATH:
    vittorio@vittorio-laptop ~ $ java -version
    java version “1.6.0_35″
    Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
    Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)

    get the JDK version:

    1) go to the jre/bin:
    vittorio@vittorio-laptop ~ $ cd /usr/java/jdk/jre/bin

    2) get the JDK version
    vittorio@vittorio-laptop /usr/java/jdk/jre/bin $ ./java -version
    java version “1.6.0_33″
    Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

    as you can se they are different

    • Mani

      The JDK version is the same as “java version”

      • Vittorio

        you can keep repeating stuff, it doesn’t become true for that :)

        • padro

          Vittorio for president.

          It’s very important to note that JDK and JRE are different entities. Different versions. Different paths.

      • jim

        Yes, right. I’ve already install netbeans 7.3.1 but when I install glassfish, it said that my JDK Version still 6 version, need to install JDK 7. So it confusing me. Can somebody help me here?

  • lee

    huh didnt work for mine god knows why :(

    • Vittorio

      because it can’t find the java command in your PATH

  • ren

    Thanks….

  • http://www.consumerscomplaints.in User

    Gr8
    Its work for me
    i am searching this solution since long time

    thanks

  • http://www.saraswatipgcollege.com/ ashok

    hi dear
    thanks its working ,its saved my log of time

    Thanks
    saraswatipgcollege.com