0

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!

Simon
  • 1
  • 3
  • [You can look at the manifest of the library](https://stackoverflow.com/q/5834794/5515060) – Lino Jun 10 '20 at 10:40
  • The library has a pom.xml file which shows the current version available in the `master` branch https://github.com/esig/dss/blob/master/pom.xml – It Assistors Jun 10 '20 at 11:19
  • as @ItAssistors said, lib has pom.xml. Maven compiler plugin talks about supported java version (https://github.com/esig/dss/blob/master/pom.xml#L193). What is not clear here is , release tag under configuration says 8. However, release configuration works only after java version 9. There are other dependencies which needs java 9(https://github.com/esig/dss/blob/master/pom.xml#L344). So I think lib requires Java 9 atleast – Pramod Jun 10 '20 at 11:51
  • Thank you Lino, It Assistors and Pramod! – Simon Jun 10 '20 at 12:22
  • @Lino Looking at the manifest is not sufficient: you can use Java 14 to target Java 8 for compilation. – Mark Rotteveel Jun 10 '20 at 13:57
  • @Pramod That could just indicate that they are using Java 11 or higher to compile, while targeting Java 8. – Mark Rotteveel Jun 10 '20 at 13:58

1 Answers1

0

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...
Fabien
  • 974
  • 9
  • 14