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

Upgrade Protege to Java 11 #822

Open
matthewhorridge opened this issue Jan 7, 2019 · 28 comments
Open

Upgrade Protege to Java 11 #822

matthewhorridge opened this issue Jan 7, 2019 · 28 comments
Assignees
Labels
Type: Enhancement A request for a change that is an enhancement

Comments

@matthewhorridge
Copy link
Contributor

No description provided.

@matthewhorridge
Copy link
Contributor Author

Relevant issue: #702 (comment)

@matthewhorridge
Copy link
Contributor Author

Relevant issue: #753

@matthewhorridge
Copy link
Contributor Author

Relevant issue: #732

@matthewhorridge matthewhorridge self-assigned this Jan 10, 2019
@matthewhorridge matthewhorridge added the Type: Enhancement A request for a change that is an enhancement label Jan 10, 2019
@csnyulas
Copy link
Member

Relevant issue: #825

@matthewhorridge
Copy link
Contributor Author

Ensure that performance is ok. See #723

@ykazakov
Copy link
Contributor

B.t.w., how do you plan go about the new Java licensing model? Switch to OpenJDK?

@matthewhorridge
Copy link
Contributor Author

For Java 11? Yes, we'll switch to OpenJDK. We've done this for WebProtege.

@ykazakov
Copy link
Contributor

ykazakov commented Jan 17, 2019

Does Protege work well with OpenJDK? I did not test.
I think even for Java 8 the updates of Oracle JDK will no longer be free.

@matthewhorridge
Copy link
Contributor Author

I need to double check both of these things

@ykazakov
Copy link
Contributor

OK, I just tried Protege with OpenJDK on MacOS 10.14.2:
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_192-b12)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.192-b12, mixed mode)
From: https://adoptopenjdk.net
Everything feels and looks just like for Oracle JDK, including the issue #723.
Just icons look funny.
screenshot 2019-01-17 at 23 11 01

@matthewhorridge
Copy link
Contributor Author

Awesome @ykazakov! Funny icons. Will have to look into this.

@matthewhorridge
Copy link
Contributor Author

For Java 8, my understanding is that we can still distribute the JRE without problems. There just won't be anymore public updates for Java 8.

@woutermont
Copy link

woutermont commented Feb 1, 2019

How is this coming along? The issue referenced above (#732, #753 and #825) still occurs when running 5.5-beta9 on Linux with Java 11.

@ykazakov
Copy link
Contributor

ykazakov commented Feb 1, 2019

@woutermont have you checked if the branch referenced in #732 works for Java11?
The current release 5.5-beta9 is for Java 8. It is unlikely that the same version of Protege will work for both Java 8 and Java 11 as there are some incompatibilities (see #732).

@woutermont
Copy link

@ykazakov my bad, I thought support for Java 11 was supposed to be ready now ... The fork doesn't work either though.

@ykazakov
Copy link
Contributor

ykazakov commented Feb 1, 2019

@woutermont if it were ready, this ticked would be closed ;-)
What is exactly in the fork not working for Java 11? @wismill mentioned that his modifications are working for Java 10.

@woutermont
Copy link

@ykazakov just the same error as mentioned in the issues, does that make sense?

@ykazakov
Copy link
Contributor

ykazakov commented Feb 1, 2019

@woutermont from which of the two branches did you build Protege? The osgi.ee error should have been fixed by the newer version of Apache Felix.

@ykazakov
Copy link
Contributor

ykazakov commented Feb 1, 2019

I just tried this branch on mac os 10.14.2: works fine with java 10.0.2 but not with 11.0.2:

CompileCommand: exclude javax/swing/text/GlyphView.getBreakSpot
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.xml.bind not found

@ykazakov
Copy link
Contributor

ykazakov commented Feb 1, 2019

Probably related to this.

@woutermont
Copy link

woutermont commented Feb 1, 2019

@woutermont from which of the two branches did you build Protege?

Ah, damn, again, my bad ... correct branch indeed gives the java.xml.bind error. Similar for the other solution offered in that same issue.

@ykazakov
Copy link
Contributor

ykazakov commented Feb 2, 2019

I think I fixed the errors. Could you give it a try?
https://github.com/liveontologies/protege/tree/feature/java11
I also created a PR based on this, but it requires some further testing.

@woutermont
Copy link

@ykazakov that seems to work! I'll work a bit with it and report any problems ...

@serasset
Copy link

serasset commented Mar 9, 2021

As I wanted to run Protege on my ARM M1 Mac natively, I had to use @ykazakov branch and I can confirm that it builds and runs correctly under the ARM native versio of openjdk@11 (installed using homebrew).

openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11)
OpenJDK 64-Bit Server VM (build 11.0.9+11, mixed mode)

Thanks !

@ykazakov
Copy link
Contributor

ykazakov commented Mar 9, 2021

@serasset Nice! I did not know that there is already a native java vor M1.

@mickbaggen
Copy link

Any chance that Protege 5.5 will be upgraded to run under OpenJDK 11 (or later)? This issue is already quite old...

@AndrewSmart
Copy link

AndrewSmart commented Jul 9, 2021

For security I like to wrap everything in Firejail, including Java. To use Java 11, in addition to the changes mentioned above, for the swrltab plugin I also had to download a CORBA implementation as CORBA was removed from Java 11. Here are the errors on launch regarding swrltab, which were later fixed with the CORBA implementation download:

Starting bundle swrltab-plugin 
Jul 09, 2021 3:13:05 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Error starting file:/opt/Protege-5.5.0/plugins/swrltab-plugin-2.0.6.jar 
org.osgi.framework.BundleException: Unable to resolve swrltab-plugin [33](R 33.0): missing requirement [swrltab-plugin [33](R 33.0)] osgi.wiring.package; (osgi.wiring.package=org.omg.CORBA) Unresolved requirements: [[swrltab-plugin [33](R 33.0)] osgi.wiring.package; (osgi.wiring.package=org.omg.CORBA)]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398) ~[org.apache.felix.main.jar:na]
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308) ~[org.apache.felix.main.jar:na]
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566) ~[org.apache.felix.main.jar:na]
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) ~[org.apache.felix.main.jar:na]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]


Plugin: SWRLTab Protege 5.0+ Plugin (2.0.6) was not successfully started.  Please see the Protégé log for more details.

Without having to setup and re-learn an environment for Java development, I manually downloaded the newer Felix from here, javax.xml.bind jar and dependencies from here, and CORBA implementation jar and dependencies from here. I placed those 6 new jars in Protege-5.5.0/bin/ also renaming the Felix jar to match what was in run.sh. Dependency links are at the right side on the bottom on each of those Maven web pages.

In run.sh in addition to javax.xml.bind I added jacorb:
--add-modules javax.xml.bind,jacorb \

Works. I should note that the glassfish-corba-orb CORBA implementation might have better performance than the JacORB implementation so feel free to benchmark if that matters... I just picked the JacORB implementation as it was less jars to download manually.

@RalphBln
Copy link

Regarding #822 (comment): 9d8c0d4 takes care of this. @matthewhorridge: I can create a pull request if you are interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement A request for a change that is an enhancement
Projects
None yet
Development

No branches or pull requests

8 participants