Bug 1363

Summary: Java 11+ Compatibility (Remove Warnings, Build and Run)
Product: [JogAmp] General Reporter: Sven Gothel <sgothel>
Component: buildsAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: critical CC: fredrik, GMoubarak, gouessej, rami.santina, Rayan, wwalker3
Priority: P1    
Version: 2.4.0   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
c7205e3906e426ec0c74b12b50faece189d3f8c2 a83fe317fc55771c18709ec201870d98c307eb13 4df8c0112b1e6f3236428cd8429d034058a98f6b 0e915e519cad5f23dcea1707b894f2b5b869bbf1 d7db7d7749a139c0238e0ae484ece39bc6b51d66 610493b1724b5d91327f478338ff5d029bdcc032 3ae05eacc091282f009792e2b06505efe96cca7d 93121714758f89a394993f0740c6929f48fb887b 760295dc597b3a91bf011115dd7bfad9c0c37f82 40863053f2c97d8dd89b41c6e2d3703f4d2f72d0 5aee782592a5ef038dfb79c7b2af5ddab81c0a21 f54e4fbaebfec36bd3b523dc4e23f744e8e6a4ef 65195899777be7be194db59bd668d22c70f29145 4df5aea16fba71b43b78fc6a878fb68c01294a3a 15549c5c038e4ef009b9b487e460c29da16c956b f12fde9dbfc79aa37303c724f094b3cef8a3f989 0577701f4d92c414dbfe6875f4319fd311e0106c 189f8ede61afea66ea14f7402dac10381a98c9ca 0f370707ed27dff495c5d091d284f7a006cb28a0 175392ceeba5f69aa5ac90e4021490ade742a323 6f987f16c808242b61263d76bd7d72e148a0af24 6603026f1bfec02e3486c52270a09a355a1bf914 493f0597646a1521074512b54c77d51fdfcca280 2d89df89453c099d4e357aa17eae88efcf1d1b70 3068420e778909e75edbed8ffd17c49c95b6e4c2 9eb21b874edb66003c642971d6c99bc22ec37e27 07c1885e9a3d1f3a3853414648c06fb3864bc69f df7c0ad3b98d3520f023e026b6163bcba2c7ee7e 14e0740459036f57a7b06ca04b66e60a7eef33ed eca5d53ab4370d73362dab8d1f0cc3eb974f16a8 8579724abe960693e2f8f853a4d651d095ca1ca7 0268e69fceb87ff7eeb1b9c61ceccf532f0cd83b 229adcb91ecb47391b93bb1c36453262acf70ff6 63e31d05ad9f1df99663997c2f04ad086f29c8fc 2ea5948b6133c4dc82533f9ce4a8fd56eb04eda2 2871688753729ae03ab23bc9043af5012bfee8c6 2dd5b6040858cbec29710be8e68374f46121a39a 4eaa83358b6518c667e9517685eeaafaef692656 c834ffbeffe454f758089c6ee17f8863acc3e7c5 ddd64dc3eb0172654aff5a4c61a389b23d92d0e3 e1c8add69973b0eae9a87cf2181a0f1cbbe62f4b 13c6bbbde5ea476d60e0a2f04a5172d3302d0edd c7858dc766cb9f76ac8f543796b1587a0f8f9279 24b75b2e91ec5f101b19fa24aa3804adb3819ebf 7ec068e0c95a230101450cc80031f76770a0cd49 4f312cc49796438394ab2d56f425536931086e8e c5431f46b7bf64f109315ec78461859dd88f202a b90fcb88cf208dad27402256e4f08659b17ba567
Workaround: ---
Bug Depends on: 1317, 1417    
Bug Blocks: 1400, 1404, 1364, 1387, 1388    

Description Sven Gothel 2019-03-28 17:42:13 CET
This bug entry acts as a parent node for all bugs related 
to Java compatibility issues beyond Java-8.

W/o writing the book about this again, I leave references for this issue:

Related Reading / Overview
- https://blog.joda.org/2018/09/from-java-8-to-java-11.html
- https://blog.joda.org/search/label/modules

Related JEPs
- http://openjdk.java.net/jeps/220 Modular JRE
- http://openjdk.java.net/jeps/260 Encapsulation
- http://openjdk.java.net/jeps/238 Multi-Release JAR Files
- http://openjdk.java.net/jeps/282 jlink (the Java linker)
- http://openjdk.java.net/jeps/261 Module System

++++

Please note that:
- Both, Java-8 and Java-11 have LTS (long time support)

- We will not test against Java-9 nor Java-10: Already outdated

- Oracle's Java build's are no more licensed for commercial use beyond Java-8

- We will only test & use OpenJDK builds starting with Java-11

++++

Now the trick question for JogAmp will be mostly:

How to provide a Java-6 backward compatible build using Java-11 toolchain,
while also supporting the Java-11 runtime and beyond?

A first trial could be starting adding a Java-11 branch for all JogAmp modules, while trying to be sensitive to [Java-6 .. Java-8] backward compatibility.
Comment 1 Wade Walker 2019-03-29 01:27:15 CET
For future reference (already known via email, but for others), my initial cut at a Java 11 build is at:

https://github.com/WadeWalker/gluegen/tree/java-11-fixes
https://github.com/WadeWalker/jogl/tree/java-11-fixes https://github.com/WadeWalker/joal/tree/java-11-fixes

These commits are a combination of:
- Build fixes: mostly to XML files, though a few to Java to fix deprecated or removed functionality
- Warning removals: removing accesses to Java internal APIs that now cause runtime warnings and will shortly be disallowed. Removal is only done where it's possible to do without removing JOGL functionality. I only removed warnings that showed up along the path to the SWT canvas, so there are still more left, I'm sure :)
Comment 2 Sven Gothel 2019-03-29 16:29:13 CET
(In reply to Wade Walker from comment #1)
> For future reference (already known via email, but for others), my initial
> cut at a Java 11 build is at:
> 
> https://github.com/WadeWalker/gluegen/tree/java-11-fixes
> https://github.com/WadeWalker/jogl/tree/java-11-fixes
> https://github.com/WadeWalker/joal/tree/java-11-fixes
> 
> These commits are a combination of:
> - Build fixes: mostly to XML files, though a few to Java to fix deprecated
> or removed functionality
> - Warning removals: removing accesses to Java internal APIs that now cause
> runtime warnings and will shortly be disallowed. Removal is only done where
> it's possible to do without removing JOGL functionality. I only removed
> warnings that showed up along the path to the SWT canvas, so there are still
> more left, I'm sure :)

Wade, your java-11 branch commits are a great source.
Great work, thank you.
I will look through it and read a bit more in the next days
then come back to you merging things somehow.

I see, the canonical preached path forward is to
package every little app with one target platform's JRE.
Crazy if you think about it. 'Docker' everywhere :)
Right, they call it micro-services these days.

The only real issue might be the Android system
when jumping towards java-11, but whatever.

I have to differentiate compatibility into:
1) runtime java language (bytecode etc)
2) runtime java classes (namespace, location, existence)
3) compile time / tooling 'makefile' stuff

I also need to see which of your commits is generic not java-11 
related and which are strict for java-11.

Over the course of next 'periods', I probably need to add a java-11
branch to all our modules and work on these.

I will probably refrain from simply cutting off Java <= 8 support,
as I don't like the idea of dropping the wide range of 
these target platforms.
Therefor I can only use your related patches as inspiration in this regard.
Comment 3 Julien Gouesse 2019-03-29 21:58:18 CET
(In reply to Sven Gothel from comment #2)
> 
> I also need to see which of your commits is generic not java-11 
> related and which are strict for java-11.

Getting rid of the call to findLibrary would be helpful even before switching to Java 11: http://forum.jogamp.org/GL-ARB-vertex-buffer-object-not-available-on-Mac-tp4039309p4039367.html
Comment 4 Sven Gothel 2019-08-20 07:04:34 CEST
This work is currently intensively progress
and visible in the java11 branches of our modules.

Compatibility matrix is:
Build + Runtime: Java >= 11
Runtime: Java 8, Java >= 11 (Should be Java >= 8)

Meaning we build the Java 8 compliant jar files
using Java 11, to defuse and simplify the operation.

In the future, we might play with jlink etc,
but this has no priority as of now.

gluegen/make/jogamp-env.xml:

<!-- Current runtime requirements are:
        - Java 1.8 (Level 8.0)
        - Android SDK API level 24 (Version 7.0 Nougat, released August 2016)

     Official production builds are performed _for_ Java 1.8.
        - Java 1.8 (Level 8.0)
        - Android SDK API level 24 (Version 7.0 Nougat, released August 2016)

     Official production builds are performed _on_ OpenJDK 11
     and a Java JDK 11 or greater is required!

     Android 7 API level 24 supports Java 1.8, 
     see https://developer.android.com/studio/write/java8-support

     Target Java 8 baseline is chosen today, June 2019, 
     since OpenJDK 1.8 is well supported on desktop, 
     mobile support is given w/ OpenJDK 9 and 
     Android also support these language features for almost 3 years.
Comment 5 Sven Gothel 2019-11-30 18:44:59 CET
Supporting Java11+ features is now covered in Bug 1404
Comment 6 Sven Gothel 2019-11-30 18:55:47 CET
gluegen commits 
c7205e3906e426ec0c74b12b50faece189d3f8c2
a83fe317fc55771c18709ec201870d98c307eb13
4df8c0112b1e6f3236428cd8429d034058a98f6b
0e915e519cad5f23dcea1707b894f2b5b869bbf1
d7db7d7749a139c0238e0ae484ece39bc6b51d66
610493b1724b5d91327f478338ff5d029bdcc032
3ae05eacc091282f009792e2b06505efe96cca7d
93121714758f89a394993f0740c6929f48fb887b
760295dc597b3a91bf011115dd7bfad9c0c37f82
40863053f2c97d8dd89b41c6e2d3703f4d2f72d0
5aee782592a5ef038dfb79c7b2af5ddab81c0a21
f54e4fbaebfec36bd3b523dc4e23f744e8e6a4ef
65195899777be7be194db59bd668d22c70f29145
4df5aea16fba71b43b78fc6a878fb68c01294a3a
15549c5c038e4ef009b9b487e460c29da16c956b
f12fde9dbfc79aa37303c724f094b3cef8a3f989
0577701f4d92c414dbfe6875f4319fd311e0106c
189f8ede61afea66ea14f7402dac10381a98c9ca
0f370707ed27dff495c5d091d284f7a006cb28a0
175392ceeba5f69aa5ac90e4021490ade742a323
6f987f16c808242b61263d76bd7d72e148a0af24
6603026f1bfec02e3486c52270a09a355a1bf914
493f0597646a1521074512b54c77d51fdfcca280
2d89df89453c099d4e357aa17eae88efcf1d1b70
3068420e778909e75edbed8ffd17c49c95b6e4c2
9eb21b874edb66003c642971d6c99bc22ec37e27
07c1885e9a3d1f3a3853414648c06fb3864bc69f

jogl commits
df7c0ad3b98d3520f023e026b6163bcba2c7ee7e
14e0740459036f57a7b06ca04b66e60a7eef33ed
eca5d53ab4370d73362dab8d1f0cc3eb974f16a8
8579724abe960693e2f8f853a4d651d095ca1ca7
0268e69fceb87ff7eeb1b9c61ceccf532f0cd83b
229adcb91ecb47391b93bb1c36453262acf70ff6
63e31d05ad9f1df99663997c2f04ad086f29c8fc
2ea5948b6133c4dc82533f9ce4a8fd56eb04eda2
2871688753729ae03ab23bc9043af5012bfee8c6
2dd5b6040858cbec29710be8e68374f46121a39a
4eaa83358b6518c667e9517685eeaafaef692656
c834ffbeffe454f758089c6ee17f8863acc3e7c5
ddd64dc3eb0172654aff5a4c61a389b23d92d0e3
e1c8add69973b0eae9a87cf2181a0f1cbbe62f4b
13c6bbbde5ea476d60e0a2f04a5172d3302d0edd
c7858dc766cb9f76ac8f543796b1587a0f8f9279
24b75b2e91ec5f101b19fa24aa3804adb3819ebf
7ec068e0c95a230101450cc80031f76770a0cd49
4f312cc49796438394ab2d56f425536931086e8e
c5431f46b7bf64f109315ec78461859dd88f202a
b90fcb88cf208dad27402256e4f08659b17ba567

I will keep it at that .. ignoring potential changes in joal and jocl
for now.
2.4.0 build effort will tackle those and I should add them here as well, Java11+ related.
Comment 7 Sven Gothel 2019-11-30 18:58:02 CET
Resolved as is, working on our major platforms: X11, Windows, MacOS, Embedded .. and so on.

Subsequent related issues until 2.4.0 build release may be added here,
then should have new bug reports.