How to check JRE version prior to launch?

前端 未结 13 2273
天命终不由人
天命终不由人 2020-12-01 11:08

What\'s the best way to determine if the version of the JRE installed on a machine is high enough for the application which the user wants to run? Is there a way of doing it

13条回答
  •  天命终不由人
    2020-12-01 12:06

    Hmm .. call me a boring guy, but what's wrong with using Launch4J or any other native launcher, for instance.

    Use a native launcher to check the JVM version before actually running your code. Java only solutions (in my book) only make sense when you deal with developers; once you hit end-users, you'll realize that they dont care about Java or its technical details at all. If you would have written your application in GW-Basic they would not care less as long as your application works.

    If Java 1.6 is not installed, lauchner4j will point the user to the download page for JDK 1.6. Thats probably more suitable for your problem than doing magic in Java.

提交回复
热议问题