Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Java 11 #1965

Closed
dr0i opened this issue Feb 6, 2024 · 7 comments · Fixed by #1967
Closed

Switch to Java 11 #1965

dr0i opened this issue Feb 6, 2024 · 7 comments · Fixed by #1967
Assignees
Labels
java Pull requests that update Java code

Comments

@dr0i
Copy link
Member

dr0i commented Feb 6, 2024

We decided to bring up our java code to a higher, maintained version. Raising java 8 to Java 11 seems to be a good start.

As we want to have our libraries (see metafacture/metafacture-core#518) also to version 11 it's mandatory for compiling to also have the play apps working with java 11.

Compatibility matrix for java, scala and sbt.

To use java 11: change the path of java in your execution environment to java 11. Also set the environment variable JAVA_HOME to java 11.

@dr0i dr0i self-assigned this Feb 6, 2024
@dr0i dr0i moved this from Backlog to Working in lobid-resources Feb 6, 2024
@dr0i dr0i added the java Pull requests that update Java code label Feb 6, 2024
@dr0i
Copy link
Member Author

dr0i commented Feb 6, 2024

We need at least scala 2.12.4 . lobid-gnd already uses this version. @fsteeg can you bring lobid-resources/web to the scala version at leats 2.12.4 and sbt > 1.1.0 as this is the minimum to be able to bump to java 11 ?

@fsteeg
Copy link
Member

fsteeg commented Feb 9, 2024

Updating to Scala 2.12.x would be a major effort, since that would require switching from Play 2.4 (via 2.5) to 2.6. The matrix from above however shows that Java 11 actually supports Scala 2.11.12, and indeed that seems to work: #1967

@fsteeg fsteeg assigned dr0i and unassigned fsteeg Feb 9, 2024
@dr0i
Copy link
Member Author

dr0i commented Feb 9, 2024

You can start the app like sbt start 7200 ? I always encounter:

The java installation you have is not up to date
requires at least version 1.6+, you have
version 11.0.21

which is a Bug an fixed with sbt 1.1.0 at least. Or have I missed something (java -version and JAVA_HOME both point to java 11).

@dr0i dr0i assigned fsteeg and unassigned dr0i Feb 9, 2024
@fsteeg
Copy link
Member

fsteeg commented Feb 9, 2024

You can start the app like sbt start 7200 ?

Oh, no, same issue here. Since sbt run worked, I took a look at the warnings on sbt start. These point to sbt stage, which creates an executable script at ./target/universal/stage/bin/lobid-resources-web.

This script supports a -no-version-check option, which seems to work:

./target/universal/stage/bin/lobid-resources-web -Dhttp.port=7200 -no-version-check

@fsteeg fsteeg assigned dr0i and unassigned fsteeg Feb 9, 2024
@dr0i
Copy link
Member Author

dr0i commented Feb 15, 2024

Ah thx, this is great news ! Have to change start scripts, too, but will work :)

dr0i added a commit that referenced this issue Feb 15, 2024
@dr0i
Copy link
Member Author

dr0i commented Feb 15, 2024

Will install java 11 tomorrow on both server and configure the start script to use java 11.

dr0i added a commit that referenced this issue Feb 16, 2024
Also remove redirection standard error to the standard output
because this redirects all java logs.
@github-project-automation github-project-automation bot moved this from Review to Done in lobid-resources Feb 16, 2024
@dr0i
Copy link
Member Author

dr0i commented Feb 16, 2024

Installed openjdk-11 and set JAVA_HOME to it.
Closed.

dr0i added a commit that referenced this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Pull requests that update Java code
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants