jeudi 4 juin 2020

Java : how to check the jdk version used to compile a .class file

On Unix/Linux:
javap -verbose MyClass | grep "major"
On Windows:
javap -verbose MyClass | findstr "major"
major version number of the class file format being used
  • Java 14 uses major version 58
  • Java 13 uses major version 57
  • Java 12 uses major version 56
  • Java 11 uses major version 55
  • Java 10 uses major version 54
  • Java 9 uses major version 53
  • Java 8 uses major version 52
  • Java 7 uses major version 51
  • Java 6 uses major version 50
  • Java 5 uses major version 49
  • Java 1.3 uses major version 47
  • Java 1.2 uses major version 46
  • Java 1.4 uses major version 48
https://en.wikipedia.org/wiki/Java_class_file#General_layout
https://stackoverflow.com/questions/1096148/how-to-check-the-jdk-version-used-to-compile-a-class-file

Aucun commentaire:

Enregistrer un commentaire

to criticize, to improve