How to check JRE version prior to launch?

前端 未结 13 2271
天命终不由人
天命终不由人 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

    An application built for a higher-version JRE will not run on a lower-version JRE. So you wouldn't be able to just add code to your application to check the JRE version - if the JRE version was incompatible, your JRE-version-checking code would not run in the first place.

    What you'd have to do is have some sort of launcher application that is built for a lower-version JRE (1.3?) that checks the version and then launches your app if necessary. This sounds kind of kludgy to me.

    What about checking the version during installation? Are you installing the app in a way that allows you to check environment variables, or do any sort of scripting?

提交回复
热议问题