chhh / batmass

Mass spectrometry data visualization
https://batmass.org
Apache License 2.0
36 stars 8 forks source link

Batmass does not run on Ubuntu 18. illegal reflective operation #15

Closed arnscott closed 5 years ago

arnscott commented 5 years ago

Trying to run Batmass on Ubuntu 18 gives the following errors:

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.netbeans.ProxyURLStreamHandlerFactory (file:/home/aaron/batmass/platform/lib/boot.jar) to field java.net.URL.handler WARNING: Please consider reporting this to the maintainers of org.netbeans.ProxyURLStreamHandlerFactory 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

In an effort to try and fix this, I updated the batmass.config to use the path to the directory of an older JDK (JDK 8) as $jdkhome. However, this does nothing and the program just fails silently. Is there some work around for this, or am I missing something completely (I could absolutely be misunderstanding what's going on!)?

chhh commented 5 years ago
  1. What does java --version say?
  2. Those you mentioned were only warnings, meaning they were not the reason it failed to launch.
  3. Did you use an installer or just trying to run from the zip file?
  4. Strange that changing jdkhome didn't help. How silently does it fail? Like won't launch and nothing happens at all?
arnscott commented 5 years ago

Thanks for the response!

  1. I'm not at my office, but I believe its 10 (tried to point it to 8 with the jdkhome overwrite).
  2. If they aren't the reason it failed to launch, it is surely related. There are 2 other people in my lab with the same warning messages on different machines and nothing opens for them either. (This was only after upgrading to Ubuntu 18, it worked previously). When attempting to start, the start-up graphic appears, but the terminal displays those warning message and then nothing opens.
  3. I used the bash script installer, but I can try running it from the .zip file tomorrow morning if you think that will help!
  4. Yes, that's exactly what happens. When trying to start, there are no warning messages, but nothing else happens (when starting from the terminal, or some GUI shortcut). At one point I tried hardcoding the path in the /batmass/bin/batmass bash script, but that end up having the same effect with a silent fail.

I purged my old installation and tried with a fresh install, but there wasn't any change.

chhh commented 5 years ago

Confirmed it's not working with java 11, but does work with java 8. There have been a lot of changes in the java world recently an transition from 8 to 9+ isn't as smooth as it should be.

I just installed 18.10 (Lubuntu) into a VM (Windows host) to test your use case:

$ sudo apt install openjdk-11-jdk
$ sudo apt install openjdk-8-jdk
$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

*select java 11 manually*

$ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing)

$ ./batmass
... it shows splash and then closes the window, process stops ...

$ sudo update-alternatives --config java

*select java 8 manually*

$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.18.10.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
$ ./batmass
... it shows splash and then closes the window, process stops again, 
even though system java is 8 ...

$ vim ../etc/batmass.conf

*uncomment and edit this line, make sure the path is just to the top level
java directory, not the bin sub-directory*:

jdkhome="/usr/lib/jvm/java-1.8.0-openjdk-amd64/"

$ ./batmass
*runs as it should*

This is not a BatMass problem, it's the whole Netbeans problem as well. Maybe I'll find time in the future to migrate the application to the newer version of the platform, but there's no other solution except changing the jdkhome variable manually in the config file.

arnscott commented 5 years ago

Awesome! Thanks for looking into this. It was just the extra manual configuration with sudo update-alternatives --config java that I needed to add and it now works.

One thing to note, just changing the jdkhome variable in the config file isn't enough, the JDK8 needs to be set as the alternative manually, too. Maybe worth adding to the README file in the section "Important Before You Begin" section so you don't get bothered with more issues like mine?

chhh commented 5 years ago

Huh, I didn't know that, it's weird. Thanks for bringing this to attention, I'll add it to the readme.

arnscott commented 5 years ago

Actually, I think I spoke too soon there! Seems to be fine when you just change the config file. Must have been something wrong with my environment! I just tested running from the .zip and using the bash script installer and it works. Sorry for the confusion!

EDIT: This may have been because I already updated the links with update-alternatives

The bash script installer doesn't create the batmass script as an executable, though, I needed to chmod +x it on 2 machines.

Thanks for clearing this up (even if it was mostly just my confusion!), annoying that the transition to java 11 is making this strange.

chhh commented 5 years ago

The binaries not being runnable has been an issue in the past. I don't know in which part of the build/deployment process do the permissions get lost. Currently the NetBeans Platform (the underlying framework this was built on), along with the NetBeans IDE itself, are in the process of being donated from Oracle to Apache. This has thrown off NB by almost two years at this point, but the process is alive and going on. NB 9/10 has been released, compatibility issues are being ironed out. Albeit slowly. It will run on Java 11+ eventually, but I'll need to revisit, update, rebuild.

arnscott commented 5 years ago

No worries then, perfect! Thanks again for the help in resolving this.