static int classFileVersionToJavaVersion(S version) {
ret classFileVersionToJavaVersion(parseFirstInt(version));
}
static int classFileVersionToJavaVersion(int majorVersion) {
if (majorVersion < 45) ret -1; // bad input
// Java 2 through 11, probably for newer versions this works too
int j = majorVersion-44;
if (j > 11) print("Warning: Please upgrade function classFileVersionToJavaVersion for JDK 12+");
ret j;
}download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1019933 |
| Snippet name: | classFileVersionToJavaVersion |
| Eternal ID of this version: | #1019933/2 |
| Text MD5: | 4335798e58363cbaed43237760fe7414 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-12-01 15:50:16 |
| Source code size: | 438 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 669 / 680 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |