Next Engine release

I wonder what is the use of the conditional statement here.

1 Like

By the way, I tested the maven artifacts uploaded into GitHub actions for jMonkeyEngine 3.6.0-alpha2 and it works fine with java 8.

But I noticed they are different from the one in maven central which does not work with java 8.

The size of jme3-core-3.6.0-alpha2.jar uploaded in the GitHub action is 1.9 MB but the one in the central is 1.8 MB.
https://repo.maven.apache.org/maven2/org/jmonkeyengine/jme3-core/3.6.0-alpha2/

1 Like

Pretty assuring, nice work.

Does this mean maven central modifies them after they are uploaded? or that JME is uploading the wrong files?

IDK, i downloaded alpha-1 locally on my disk and its 1.9 mb, i think its just a minimal differences in file systems.

EDIT:
Have you tested the jar ?

Yes, the one in maven.zip form GitHub actions works fine with java 8.

but the one in maven central does not work with java 8.

1 Like

I think we should add a compiled-by: <java-version> here on the manifest:

So, it would be:

jar {
    manifest {
        attributes 'Implementation-Title': 'jMonkeyEngine',
                   'Implementation-Version': jmeFullVersion,
                   'Automatic-Module-Name': "${project.name.replace("-", ".")}"
                   'Compiled-by': JavaVersion.current()
    }
}

So, it could be displayed on the jar file MANIFEST metadata.

If there is also a full function that returns all the information about the current consumed java, it will be fine i think.

EDIT:
This is just for future to avoid this dilemma again.

2 Likes

I am considering publishing alpha3 tomorrow with the changes suggested by pspeed and seeing if it will make any difference.

2 Likes

Are we sure that the maven repository even has alpha2?

Browsing The jme3-core entry makes it appear that they only have up to alpha1 (which is a whole different issue of it’s own)

2 Likes

Well, not sure why they are not still listed in https://mvnrepository.com/artifact/org.jmonkeyengine/jme3-core but they are available at Central Repository: org/jmonkeyengine/jme3-core/3.6.0-alpha2 and Gradle can grab them.

2 Likes

There is an hour or two of lag between synching artifacts to Maven Central and seeing them show up on Maven Central Repository Search. Perhaps that explains the discrepancy.

1 Like

My fault—sorry! See PR 1714. It’s easily worked around, though.

That is a good idea

2 Likes

Oracle JDK adds it by default, so that’s why i suggested it.
image

1 Like

Seems the “release=8” option fixed the java 8 compatibility. The newly added “Created-By” manifest field shows the jars are created by java 11 (Eclipse Adoptium) probably picked by the toolchain(?)

The 3.6.0-alpha3 is published on GitHub but I have not released the artifacts to maven central yet. They are staged in the SonaType if someone wants to try it out. You need to add this to your Gradle build:

repositories {
      maven { url 'https://s01.oss.sonatype.org/content/groups/staging' }
}

For the change log see:

2 Likes

I think that because the gradle-wrapper.jar is compiled with java11, so it cannot run on 8 (it will be forced to use jdk-11) but specifying a release8 will provide the compiled bytecode the backward compatibility with java 8.

https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#standard-options

The --release and the --target compiler options.

2 Likes

Following this fact, i believe also that this title and the usage of java 8 in gradle 7.6 is misleading; because it gets ignored and the output is compiled with java11+.

1 Like

https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_cross_compilation

EDIT:
This explains the issue in details, and we should remove java 8 from the github runner images.

I have created a PR, but i will draft it until i read the deploy flags; i think the jdk 11 deploy flag need to be settled to true.

1 Like

Why not deploy with 17 then? Asuming that the release=8 flag does the magic :slightly_smiling_face:

2 Likes

I guess no problem, jdk makes things easy and portable unlike natives.

1 Like