简体   繁体   中英

How to know what JDK version a project is developed on?

I need to use a Java library ( https://github.com/esig/dss ) in C# using IKVM.NET. IKVM.NET supports JDK 8, how can I know if the library is using a later version? It doesn't really appear anywhere on the documentation or on the JavaDoc. Am I missing something?

Thanks in advance!

After compiling the Java project, to make sure which java version was used you can execute this command on one of the class file generated (javap is a binary located in your JAVA_HOME directory):

javap -verbose <Name of your class>.class | grep "major version"

Example of output:

major version: 52

And the following list will give you the mapping between the major version and the java version:

  • Java 5 uses major version 49
  • Java 6 uses major version 50
  • Java 7 uses major version 51
  • Java 8 uses major version 52
  • Java 9 uses major version 53
  • Java 10 uses major version 54
  • Java 11 uses major version 55
  • etc...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM