Closed tresf closed 7 years ago
Closing this out since turning Java's version string into a valid SemVer will fix it.
The following snippet will fix Java version parsing...
This will turn 1.8.0_42
to 1.8.0-42
and fix the parsing error...
- Version v = Version.valueOf(System.getProperty("java.version"));
+ Version v = Version.valueOf(System.getProperty("java.version").replaceFirst("_", "-"));
Java's own internal version scheme is:
1.8.0_121
However when attempting to parse Java's own version information the following exception is raised.
I've tried replacing the underscore with a period and it raises a similar error:
Unexpected character 'DOT(.)' at position '5', expecting '[HYPHEN, PLUS, EOI]'
This seems like the most basic use-case inspired by a very simple Oracle version parsing. Am I using the library wrong, or is Oracle's own format not supported by this library?
The use-case is to test for a specific update level inside Java (e.g.
u121
vsu141
).