Timeline for Write a java code to detect the JVM version
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 28, 2014 at 2:58 | comment | added | kernigh | Java 1.1.8 (in MRJ 2.2.6) failed to compile this, until I added 17 more tokens: protected Class loadClass(String name, boolean resolve) { return Object.class; }. The current API docs neglect to mention how this was an abstract method before Java 1.2. I return Object.class because the method gets one call for "java.lang.Object". | |
| Feb 27, 2014 at 4:59 | history | edited | Justin | CC BY-SA 3.0 | Syntax Coloring |
| Dec 11, 2012 at 1:22 | vote | accept | Victor Stafusa | ||
| Mar 19, 2017 at 20:29 | |||||
| Dec 1, 2012 at 23:16 | comment | added | Victor Stafusa | Good point. I forgot about that. | |
| Dec 1, 2012 at 23:14 | comment | added | Peter Taylor | @Victor, that would complicate the question of whether it supports 7 different versions even more. I'm not aware of any compiler which supports Java 5 syntax and compiles to Java 1-compatible class files. | |
| Dec 1, 2012 at 22:51 | comment | added | Victor Stafusa | Your answer is genial. Could trivially reduce to 83 tokens using String... args. | |
| Dec 1, 2012 at 22:02 | comment | added | Victor Stafusa | Counted 84 tokens. Still did not tested it though. | |
| Dec 1, 2012 at 21:57 | history | answered | Peter Taylor | CC BY-SA 3.0 |