Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835455 - app-misc/xmind-3.7.6_p201801311814: Cannot launch on JRE 11+: java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
Summary: app-misc/xmind-3.7.6_p201801311814: Cannot launch on JRE 11+: java.lang.NoCla...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-17 01:35 UTC by Ryan Tsien
Modified: 2024-04-11 18:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info app-misc/xmind (emerge-info-of-xmind.txt,8.16 KB, text/plain)
2022-03-18 02:12 UTC, Ryan Tsien
Details
.xmind/workspace-cathy/.metadata/.log (.log,217.52 KB, text/plain)
2022-03-18 02:28 UTC, Ryan Tsien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Tsien 2022-03-17 01:35:42 UTC
console-log:

> * Home for VM 'openjdk-bin-8' does not exist: //usr/lib/jvm//openjdk-bin-8
> * Invalid System VM: openjdk-bin-8

```
JVM terminated. Exit code=1
/usr/bin/java
-Dfile.encoding=UTF-8
-Dosgi.instance.area=@user.home/.xmind/workspace-cathy
-Dosgi.configuration.area=@user.home/.xmind/configuration-cathy
-jar /opt/xmind/plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /opt/xmind/XMind/XMind
-name XMind
--launcher.library /opt/xmind/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444/eclipse_1617.so
-startup /opt/xmind/plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
--launcher.overrideVmargs
-exitdata 2001e ../workspace
-eclipse.keyring @user.home/.xmind/secure_storage_linux
-vm /usr/bin/java
-vmargs
-Dfile.encoding=UTF-8
-Dosgi.instance.area=@user.home/.xmind/workspace-cathy
-Dosgi.configuration.area=@user.home/.xmind/configuration-cathy
-jar /opt/xmind/plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar 
```

After manually installing `=dev-java/openjdk-bin-8.322_p06` it works fine, so I think it's bound to jdk-8.

Reproducible: Always
Comment 1 Yuan Liao (Leo3418) 2022-03-17 23:17:49 UTC
I cannot reproduce this issue.  Could you paste each of the following commands' output here?

- emerge --info app-misc/xmind
- eselect java-vm list
- ls -l /usr/lib/jvm/
Comment 2 Yuan Liao (Leo3418) 2022-03-17 23:22:40 UTC
Forgot to mention in the above comment: please paste those commands' output when your system is in the state where this bug can be reproduced. Thanks!
Comment 3 Ryan Tsien 2022-03-18 02:12:54 UTC
Created attachment 767286 [details]
emerge --info app-misc/xmind

Hi, this is the info

$ eselect java-vm list
Available Java Virtual Machines:
  [1]   openjdk-bin-11

$ ls -l /usr/lib/jvm
total 4
lrwxrwxrwx 1 root root 27  2月  2 18:57 openjdk-bin-11 -> /opt/openjdk-bin-11.0.14_p9
Comment 4 Yuan Liao (Leo3418) 2022-03-18 02:18:30 UTC
(In reply to Ryan Qian from comment #3)
> Created attachment 767286 [details]
> emerge --info app-misc/xmind
> 
> Hi, this is the info
> 
> $ eselect java-vm list
> Available Java Virtual Machines:
>   [1]   openjdk-bin-11
> 
> $ ls -l /usr/lib/jvm
> total 4
> lrwxrwxrwx 1 root root 27  2月  2 18:57 openjdk-bin-11 ->
> /opt/openjdk-bin-11.0.14_p9

So it seems like there isn't a system VM selected.  At this point, after running 'eselect java-vm set system openjdk-bin-11', you should be able to launch the program.

I also suspect that the previous system VM on your system was openjdk-bin-8, but it got uninstalled at some point, and the system VM preference has never been updated (it would not be done automatically).

The output of 'eselect java-vm list' shall look similar to the following, where exactly one VM has been selected as the system VM:

$ eselect java-vm list
Available Java Virtual Machines:
  [1]   openjdk-8 
  [2]   openjdk-bin-8  system-vm
  [3]   openjdk-bin-11 
  [4]   openjdk-bin-17
Comment 5 Ryan Tsien 2022-03-18 02:28:15 UTC
Created attachment 767287 [details]
.xmind/workspace-cathy/.metadata/.log

(In reply to Yuan Liao (Leo3418) from comment #4)

> So it seems like there isn't a system VM selected.  At this point, after
> running 'eselect java-vm set system openjdk-bin-11', you should be able to
> launch the program.

Thanks for your reply, but if I set jdk-11 as the system-vm (without jdk-8 installed), a new error occured:

> $ xmind --illegal-access=warn
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/opt/xmind/plugins/org.eclipse.osgi_3.11.0.v20160603-1336.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
> WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller
> WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
> WARNING: All illegal access operations will be denied in a future release
Comment 6 Yuan Liao (Leo3418) 2022-03-18 02:38:24 UTC
(In reply to Ryan Qian from comment #5)
> Thanks for your reply, but if I set jdk-11 as the system-vm (without jdk-8
> installed), a new error occured:
> 
> > $ xmind --illegal-access=warn
> > WARNING: An illegal reflective access operation has occurred
> > WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/opt/xmind/plugins/org.eclipse.osgi_3.11.0.v20160603-1336.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
> > WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller
> > WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
> > WARNING: All illegal access operations will be denied in a future release

These are just warnings rather than errors.  They are not supposed to break any functionality.  I have been getting the same type of warnings from some other packages on Java 11 too but have never run into any actual issues.  Do you encounter any other more severe bugs on Java 11?  I would just ignore these warnings if everything operates normally.

This kind of warnings is quite common when a package was built with JDK 8 but is used on JRE 11.  This particular package seems to be a pre-built binary package (judging from its empty src_compile), and presumably it was built with JDK 8, so there is nothing we could do about the warnings.  But they are just *warnings*, and they virtually can always be safely ignored.
Comment 7 Ryan Tsien 2022-03-18 02:43:12 UTC
(In reply to Yuan Liao (Leo3418) from comment #6)

> These are just warnings rather than errors.  They are not supposed to break
> any functionality. 

It actually  causes xmind to exit. Here is a popup windows and say

> An error has occurred. See the log file
/home/ryan/.xmind/workspace-cathy/.metadata/.log.

and I have uploaded the log in the previous comment.
Comment 8 Yuan Liao (Leo3418) 2022-03-18 02:50:33 UTC
(In reply to Ryan Qian from comment #7)
> (In reply to Yuan Liao (Leo3418) from comment #6)
> 
> > These are just warnings rather than errors.  They are not supposed to break
> > any functionality. 
> 
> It actually  causes xmind to exit. Here is a popup windows and say
> 
> > An error has occurred. See the log file
> /home/ryan/.xmind/workspace-cathy/.metadata/.log.
> 
> and I have uploaded the log in the previous comment.

My apologies, I didn't notice it.

So it looks like the program needs javax.annotation, which exists in Java 8 but has been removed afterwards: https://stackoverflow.com/questions/56855335/javax-annotation-classes-and-java-11-jdk.
Comment 9 Yuan Liao (Leo3418) 2022-03-18 02:57:24 UTC
But for what it's worth, the warnings have nothing to do with that error at launch.  The error's actual cause is the absence of a javax package, which is a very common issue we have observed in migration to Java 11.  On the other hand, the warning is just about bad use of reflection, which is a different, unrelated thing.

Once javax.annotation is installed properly, I think the program should work, even if the warnings will not be eliminated -- unless there are some other issues...
Comment 10 lexofleviafan 2023-11-20 19:46:02 UTC
On JDK 9+, XMind fails to run out of the box due to java.net.* access restrictions. This can be fixed by adding these lines to /opt/xmind/XMind/XMind.ini:
>--add-opens
>java.base/java.net=ALL-UNNAMED

As for javax.annotation.*, it's actually included in the package:
>/opt/xmind/plugins/javax.annotation_1.2.0.v201602091430.jar

However, its manifest appears to be invalid: it includes an Import-Package header that's identical to its own Export-Package header. Whether because of that, or for some other reason, the JAR file doesn't seem to get loaded properly.