PP is incompatible with Java 17
See original GitHub issueDescribe the bug Java 17 is now available and the current LTS release. It now enforces strong encapsulation.
This behaviour was already the default in JDK 16, but overridden by PP using the flag --illegal-access=permit
in PortfolioPerformance.ini. This flag has now been removed.
PP can therefore no longer load or save portfolio XMLs and reports with the following message:
OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=permit; support was removed in 17.0
WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.foreign
Exception in thread "Thread-4" java.lang.NoClassDefFoundError: Could not initialize class com.thoughtworks.xstream.converters.collections.TreeMapConverter
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:350)
at name.abuchen.portfolio.model.ClientFactory.xstream(ClientFactory.java:1178)
at name.abuchen.portfolio.model.ClientFactory.access$0(ClientFactory.java:1174)
at name.abuchen.portfolio.model.ClientFactory$XmlSerialization.load(ClientFactory.java:104)
at name.abuchen.portfolio.model.ClientFactory$PlainWriter.load(ClientFactory.java:142)
at name.abuchen.portfolio.model.ClientFactory.load(ClientFactory.java:415)
at name.abuchen.portfolio.ui.editor.LoadClientThread.run(LoadClientThread.java:34)
(Note that the same stacktrace was observed in #2440; for some reason a new installation fixed the problem there. However, having a Java 17 installed as the system default, I can reliably reproduce the above error even after a clean reinstallation.)
PP should update and/or avoid dependencies that access internals of other modules (which has been deprecated since Java 9), to maintain compatibility with modern Java releases.
To Reproduce Steps to reproduce the behavior:
- Have the system’s default Java be version 17 (if necessary, install via APT and
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
) - Run PortfolioPerformance
- Try to open a portfolio XML file.
Alternatively, try creating a new portfolio file (this works) and save it (this doesn’t).
Now, set system Java to another version (sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
) and try again - PP works as expected.
Expected behavior PP loads and saves portfolios from/to XML files.
Screenshots:
Loading a file:
The UI (e.g., menu bar) remains responsive, but loading does not continue.
Saving a file:
The save file is created but remains empty.
Desktop:
- OS: Linux x86_64 (Xubuntu 21.04 hirsute)
- Version: 0.55.0
- Java: 17+35-Ubuntu-121.04 installed via APT (openjdk-17-jre:amd64, version 17+35-1~21.04)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Same problem here, this time on Arch Linux with the default openjdk as of now. Installing
jdk11-openjdk
and switching to it witharchlinux-java set java-11-openjdk
“fixes” the issue - now my portfolio file actually opens.Seems like gentoo now comes with openjdk-17 per default. You can install v11 in parallel and then switch the version to 11 for your user only:
$ eselect java-vm set user openjdk-bin-11