Bug 958 - Add support for OpenJDK version notation
Summary: Add support for OpenJDK version notation
Alias: None
Product: Gluegen
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: All all
: P1 critical
Assignee: Sven Gothel
Depends on:
Reported: 2014-02-02 15:49 CET by Manu
Modified: 2014-02-24 23:38 CET (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Manu 2014-02-02 15:49:41 CET
In OpenJDK, Java version notation is a little different from Oracle JDK one:
OpenJDK uses "-u" instead of "_" to separate the version number from the update number, i.e. "1.7.0-u60-b04" vs "1.7.0_60-ea".
That would be nice to take this into account in the static initializer of jogamp.common.os.PlatformPropsImpl class. You could simply replace the line: 
  final int usIdx = JAVA_VERSION.lastIndexOf("_");
  final int usIdx = JAVA_VERSION.replace("-u", "_").lastIndexOf("_");
If you want to program it better, you can also test the "java.runtime.name" property that returns "OpenJDK Runtime Environment" for OpenJDK.

See also bug #944 https://jogamp.org/bugzilla/show_bug.cgi?id=944
Comment 1 Sven Gothel 2014-02-16 06:34:44 CET
  Done .. avoding the replace op.

Pls validate!

Thank you Manu.
Comment 2 Manu 2014-02-24 23:38:05 CET
Works for OpenJDK 1.7.0-u60-b04 and Oracle Java 1.7.0_60-ea

Thanks for the fix :-)