What is the difference in properties java.runtime.version and java.version The Next CEO of Stack OverflowWhat is reflection and why is it useful?Differences between HashMap and Hashtable?What is the difference between public, protected, package-private and private in Java?What is a serialVersionUID and why should I use it?Difference between StringBuilder and StringBufferDifference between wait() and sleep()What is the difference between JDK and JRE?What is a JavaBean exactly?What's the difference between @Component, @Repository & @Service annotations in Spring?What exactly is Apache Camel?

Why here is plural "We went to the movies last night."

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

Is it okay to store user locations?

WOW air has ceased operation, can I get my tickets refunded?

How should I support this large drywall patch?

Why does standard notation not preserve intervals (visually)

How to use tikz in fbox?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Why does C# sound extremely flat when saxophone is tuned to G?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

How long to clear the 'suck zone' of a turbofan after start is initiated?

What's the point of interval inversion?

Term for the "extreme-extension" version of a straw man fallacy?

What does this shorthand mean?

Can I equip Skullclamp on a creature I am sacrificing?

What do "high sea" and "carry" mean in this sentence?

Implement the Thanos sorting algorithm

Should I tutor a student who I know has cheated on their homework?

Why didn't Khan get resurrected in the Genesis Explosion?

How to safely derail a train during transit?

Can the Reverse Gravity spell affect the Meteor Swarm spell?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Science fiction (dystopian) short story set after WWIII

What can we do to stop prior company from asking us questions?



What is the difference in properties java.runtime.version and java.version



The Next CEO of Stack OverflowWhat is reflection and why is it useful?Differences between HashMap and Hashtable?What is the difference between public, protected, package-private and private in Java?What is a serialVersionUID and why should I use it?Difference between StringBuilder and StringBufferDifference between wait() and sleep()What is the difference between JDK and JRE?What is a JavaBean exactly?What's the difference between @Component, @Repository & @Service annotations in Spring?What exactly is Apache Camel?










6















For logging purposes I'm getting the Java version written in log while Java program is running.



I found out that I can get the version with



System.getProperty("java.runtime.version") -> 1.8.0_202-b08


and



System.getProperty("java.version") -> 1.8.0_202


Result obviously is missing the "build" information in other but are there any other difference besides the result? Any certain cases when I should be using the first option rather than the second?










share|improve this question

















  • 2





    I’m not sure you can rely on java.runtime.version anymore, considering it is not documented. I would avoid it altogether.

    – VGR
    11 hours ago















6















For logging purposes I'm getting the Java version written in log while Java program is running.



I found out that I can get the version with



System.getProperty("java.runtime.version") -> 1.8.0_202-b08


and



System.getProperty("java.version") -> 1.8.0_202


Result obviously is missing the "build" information in other but are there any other difference besides the result? Any certain cases when I should be using the first option rather than the second?










share|improve this question

















  • 2





    I’m not sure you can rely on java.runtime.version anymore, considering it is not documented. I would avoid it altogether.

    – VGR
    11 hours ago













6












6








6








For logging purposes I'm getting the Java version written in log while Java program is running.



I found out that I can get the version with



System.getProperty("java.runtime.version") -> 1.8.0_202-b08


and



System.getProperty("java.version") -> 1.8.0_202


Result obviously is missing the "build" information in other but are there any other difference besides the result? Any certain cases when I should be using the first option rather than the second?










share|improve this question














For logging purposes I'm getting the Java version written in log while Java program is running.



I found out that I can get the version with



System.getProperty("java.runtime.version") -> 1.8.0_202-b08


and



System.getProperty("java.version") -> 1.8.0_202


Result obviously is missing the "build" information in other but are there any other difference besides the result? Any certain cases when I should be using the first option rather than the second?







java






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 12 hours ago









JokkeriJokkeri

15815




15815







  • 2





    I’m not sure you can rely on java.runtime.version anymore, considering it is not documented. I would avoid it altogether.

    – VGR
    11 hours ago












  • 2





    I’m not sure you can rely on java.runtime.version anymore, considering it is not documented. I would avoid it altogether.

    – VGR
    11 hours ago







2




2





I’m not sure you can rely on java.runtime.version anymore, considering it is not documented. I would avoid it altogether.

– VGR
11 hours ago





I’m not sure you can rely on java.runtime.version anymore, considering it is not documented. I would avoid it altogether.

– VGR
11 hours ago












3 Answers
3






active

oldest

votes


















4
















System Property Name | System Property Content | Where Displayed in java version Output
---------------------|--------------------------|---------------------------------------
java.version | product version | Line one displays the product version
---------------------|--------------------------|---------------------------------------
java.runtime.version | product version | Line one displays the product version
| product build identifier | Line two displays the build identifier


See J2SE SDK/JRE Version String Naming Convention






share|improve this answer
































    4














    java.version is a product version information of Java Runtime environment(JRE). JRE is an implementation of the Java Virtual Machine which actually executes Java programs.



    java.runtime.version is a product version along with build identifier of JRE.






    share|improve this answer
































      3














      One is JDK version, java.version and as the name suggest other is JRE version, R for the runtime






      share|improve this answer























        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399001%2fwhat-is-the-difference-in-properties-java-runtime-version-and-java-version%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4
















        System Property Name | System Property Content | Where Displayed in java version Output
        ---------------------|--------------------------|---------------------------------------
        java.version | product version | Line one displays the product version
        ---------------------|--------------------------|---------------------------------------
        java.runtime.version | product version | Line one displays the product version
        | product build identifier | Line two displays the build identifier


        See J2SE SDK/JRE Version String Naming Convention






        share|improve this answer





























          4
















          System Property Name | System Property Content | Where Displayed in java version Output
          ---------------------|--------------------------|---------------------------------------
          java.version | product version | Line one displays the product version
          ---------------------|--------------------------|---------------------------------------
          java.runtime.version | product version | Line one displays the product version
          | product build identifier | Line two displays the build identifier


          See J2SE SDK/JRE Version String Naming Convention






          share|improve this answer



























            4












            4








            4









            System Property Name | System Property Content | Where Displayed in java version Output
            ---------------------|--------------------------|---------------------------------------
            java.version | product version | Line one displays the product version
            ---------------------|--------------------------|---------------------------------------
            java.runtime.version | product version | Line one displays the product version
            | product build identifier | Line two displays the build identifier


            See J2SE SDK/JRE Version String Naming Convention






            share|improve this answer

















            System Property Name | System Property Content | Where Displayed in java version Output
            ---------------------|--------------------------|---------------------------------------
            java.version | product version | Line one displays the product version
            ---------------------|--------------------------|---------------------------------------
            java.runtime.version | product version | Line one displays the product version
            | product build identifier | Line two displays the build identifier


            See J2SE SDK/JRE Version String Naming Convention







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 11 hours ago

























            answered 12 hours ago









            fantaghiroccofantaghirocco

            3,80452738




            3,80452738























                4














                java.version is a product version information of Java Runtime environment(JRE). JRE is an implementation of the Java Virtual Machine which actually executes Java programs.



                java.runtime.version is a product version along with build identifier of JRE.






                share|improve this answer





























                  4














                  java.version is a product version information of Java Runtime environment(JRE). JRE is an implementation of the Java Virtual Machine which actually executes Java programs.



                  java.runtime.version is a product version along with build identifier of JRE.






                  share|improve this answer



























                    4












                    4








                    4







                    java.version is a product version information of Java Runtime environment(JRE). JRE is an implementation of the Java Virtual Machine which actually executes Java programs.



                    java.runtime.version is a product version along with build identifier of JRE.






                    share|improve this answer















                    java.version is a product version information of Java Runtime environment(JRE). JRE is an implementation of the Java Virtual Machine which actually executes Java programs.



                    java.runtime.version is a product version along with build identifier of JRE.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 11 hours ago

























                    answered 12 hours ago









                    Aniket SahrawatAniket Sahrawat

                    6,24821339




                    6,24821339





















                        3














                        One is JDK version, java.version and as the name suggest other is JRE version, R for the runtime






                        share|improve this answer



























                          3














                          One is JDK version, java.version and as the name suggest other is JRE version, R for the runtime






                          share|improve this answer

























                            3












                            3








                            3







                            One is JDK version, java.version and as the name suggest other is JRE version, R for the runtime






                            share|improve this answer













                            One is JDK version, java.version and as the name suggest other is JRE version, R for the runtime







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 12 hours ago









                            Rohail UsmanRohail Usman

                            447




                            447



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399001%2fwhat-is-the-difference-in-properties-java-runtime-version-and-java-version%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Styletc

                                Tórshavn Kliima | Partnerstääden | Luke uk diar | Nawigatsjuun62° 1′ N, 6° 46′ W62° 1′ 0″ N, 6° 46′ 0″ WWMOTórshavn