JDK 11 Build Support

Ehm, I think I found one:

But as I have never worked with android before, I do not know how should I use it, so is anyone willing to give it a try using JDK-11 branch built using JDK8 here :

This was a good opportunity for me to learn and test android using above gradle template.

I locally compiled jdk-11 branch with Java 8 and created a hello world (blue cube) example apk and I was able to run it on my phone with android 4.0.3 successfully.

I used following tutorial to install android sdk on linux (No need to install Android Studio at all) :

Then I set sdk path in

also changed this line :

to :

classpath 'com.android.tools.build:gradle:3.3.2'

and commented out this line:

    // We do not need this, as each version of the Android Gradle Plugin now has a default version of the build tools.
    //buildToolsVersion "24.0.2"

Edit:
btw, we can compile it even with java 11 (with no need to have java 8 installed), we just need to set “–release 8” flag to java compiler in gradle build. (I have not tested this myself yet)

compileJava {
  options.compilerArgs.addAll(['--release', '8')]
}

see this for more info:
https://github.com/gradle/gradle/issues/2510

Edit 2:
Forgot this one, I also add

mavenLocal()
mavenCentral()
google()

in

and

3 Likes

I’m using JDK8 with JME and Android. It is working perfectly so far.

2 Likes

Thanks guys, new PR is tested successfully on Linux, Android, Windows.
We will appreciate if someone can test it on Mac too :slightly_smiling_face:

2 Likes

The problem I see with JDK11 is not current compatibility. Rather, it is the new Oracle phylosophy to break stuff every 6 months, which means that we won’t be able to keep up and will fragment the community until death.

2 Likes

The major breaks the happened in jdk 9-11 we’re a Java cleanup of sorts. They we’re removing all of the old build tools and finished separating javaee from se. And although it causes a lot of growing pains, it will make the environment cleaner moving forward.

My understanding is that the only large change that came out in jdk12 is the disability to use reflection under what we consider normal circumstances. It is still possible, but will require modules to be fully implemented. Perhaps someone here might know more about that?

1 Like

Thanks, millennial* hipsters and Angular team! (Yeah, I’m just going to guess that the trendy 6 month Angular release cycle had something to do with that.)

*sorry to any millennials here with common sense

Has anyone had a chance to test this branch on OS X. I would love to get this merged in.

Even if no one had a chance to test it with OSx I think yet we are fine to merge it as it is going to appear on alpha release anyway, so people will have better chance to test it on 3.3.0-alpha2. :slightly_smiling_face:

2 Likes

What exactly needs to be tested on OSX? Just compiling with JDK11?

Yep, just compiling and perhaps running a test to make sure it still loads.

EDIT: @Ali_RS I agree, there is no reason that it should break on OS X if it works on Windows and Linux. All this PR done is change the build process.

btw, it also compiles fine with jdk12 too. Just tested it :slightly_smiling_face:

1 Like

That is awesome! Thank you for testing that!
Did you try to run it? I am wondering if it will have reflection access issues…

I was able to run TestAnimMigration successfully.

I just got these two notes:

Note: /media/ali/My Passport/Java/jME_NB-PW-11-6-2015/jmonkeyengine/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /media/ali/My Passport/Java/jME_NB-PW-11-6-2015/jmonkeyengine/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java uses unchecked or unsafe operations.

Do you have any special test in your mind ?

1 Like

How about something with native bullet. I always get a bunch of reflection warnings with it.

Tested bunch of tests with native bullet, they run fine without any warning for me.

1 Like

Sweet thank you!

1 Like

If you submit a PR, TravisCI will test the build on OSX.

Most things spider monkey related will use reflection… at least anything using the serialization stuff likely uses reflection.

This PR is merged and is available on master branch now.

2 Likes