How to get the current Java version available?

后端 未结 3 958
清歌不尽
清歌不尽 2021-01-20 06:36

How do i get the current Java version available using c#?

I have been able to find a way to get the java version on my PC using C# but I need to be able to compare

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-20 07:18

    Find all the java.exe files and run them as "java -version". The output looks something like this:

    java version "1.6.0_35"
    Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
    Java HotSpot(TM) Client VM (build 20.10-b01, mixed mode, sharing)
    

    So you can tell the version.

    You should also look for the folder structure used by an installed java version.

提交回复
热议问题