Libraryless. Click here for Pure Java version (2863L/17K).
1 | static int latestInstalledJavaX() { |
2 | File[] files = new File(userHome(), ".javax").listFiles(); |
3 | int v = 0; |
4 | if (files != null) for (File f : files) { |
5 | Matcher m = regexpMatcher("x(\\d\\d\\d?)\\.jar", f.getName()); |
6 | if (m.matches()) |
7 | v = Math.max(v, Integer.parseInt(m.group(1))); |
8 | } |
9 | return v; |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1001144 |
Snippet name: | latestInstalledJavaX |
Eternal ID of this version: | #1001144/2 |
Text MD5: | 296599fe65c6f69ce995fc218f57bca8 |
Transpilation MD5: | 41c9dcf41fdeeeb564f08a7e472f6977 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-04-05 23:20:05 |
Source code size: | 321 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 620 / 2585 |
Version history: | 1 change(s) |
Referenced in: | [show references] |