HUPO-PSI / mzIdentML

Repository for mzIdentML and the corresponding examples
23 stars 24 forks source link

can't launch the validator #111

Closed prvst closed 1 year ago

prvst commented 5 years ago

Hi,

I need some assistance with the mzID validator. I'm trying to run it on Linux.

command: java -Xms2048m -jar mzIdentMLValidator-1.4.34-SNAPSHOT.jar

error: Error: Unable to initialize main class psidev.psi.pi.validator.MzIdentMLValidatorGUI

andrewrobertjones commented 5 years ago

@germa Gerhard, would you mind responding to this one?

germa commented 5 years ago

If you use Java 8, please try: java -Xms2048m -cp .\lib -jar mzIdentMLValidator-1.4.34-SNAPSHOT.jar

For Java 9, 10, 11 try java -Xms2048m --add-modules java.xml.bind -cp .\lib -jar mzIdentMLValidator-1.4.34-SNAPSHOT.jar

prvst commented 5 years ago

I have Java 11:

openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

I tried his: java -Xms2048m --add-modules java.xml.bind -cp .\lib -jar mzIdentMLValidator-1.4.34-SNAPSHOT.jar

and got this:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.xml.bind not found
germa commented 5 years ago

Sorry, my mistake. The old version mzIdentMLValidator-1.4.34-SNAPSHOT.jar ran only with Java 9 and 10.

I compiled now a new version, which runs with Java 11 and 12: java -Xms2048m -cp .\lib -jar .\mzIdentMLValidator-1.4.35-SNAPSHOT.jar

You can start it with run.bat after you adapted the variable JAVA_HOME pointing to your Java installation.

prvst commented 5 years ago

Got a different error now, same JDK as I described above:

Error: LinkageError occurred while loading main class psidev.psi.pi.validator.MzIdentMLValidatorGUI
java.lang.UnsupportedClassVersionError: psidev/psi/pi/validator/MzIdentMLValidatorGUI has been
compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java
Runtime only recognizes class file versions up to 55.0
germa commented 5 years ago

I think the problem is that you the old Java 11, see https://stackoverflow.com/questions/9170832/list-of-java-class-file-format-major-version-numbers Please try again with Java 12, e.g. from https://jdk.java.net/12/ or https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html

prvst commented 4 years ago

sorry for the long delay. We have Java 11 (openjdk version "11.0.5" 2019-10-15) on our systems, I would like to avoid changing that. I'm still having issues with the validator:

> java -Xms2048m --add-modules java.xml.bind -cp .\lib -jar mzIdentMLValidator-1.4.35-SNAPSHOT.jar`
Error occurred during initialization of boot layer. java.lang.module.FindException: Module java.xml.bind not found

I did some digging and apparently java.xml.bind is deprecated since Java 9 and was removed from Java 11. The link contains a fix for the issue as well.

germa commented 4 years ago

@Felipe: can you please try without --add-modules java.xml.bind : java -Xms2048m -cp .\lib -jar mzIdentMLValidator-1.4.35-SNAPSHOT.jar

prvst commented 4 years ago

got this:

Error: LinkageError occurred while loading main class psidev.psi.pi.validator.MzIdentMLValidatorGUI
    java.lang.UnsupportedClassVersionError: psidev/psi/pi/validator/MzIdentMLValidatorGUI has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class
nicorellius commented 4 years ago

I'm seeing the same problem here... Validator version 1.4.35 failing to launch on Ubuntu 18.04, Java 11.0.6:

Setting JAR as executable and running:

java -jar mzIdentMLValidator-1.4.35-SNAPSHOT.jar

fails with the following error:

Error: LinkageError occurred while loading main class
psidev.psi.pi.validator.MzIdentMLValidatorGUI
java.lang.UnsupportedClassVersionError: psidev/psi/pi/validator/MzIdentMLValidatorGUI
has been compiled by a more recent version of the Java Runtime (class file version
56.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Running run.sh also fails:

Error: Unable to access jarfile mzIdentMLValidator-1.4.35-SNAPSHOT.jar

Permissions are correct and I can run other JARs no problem. Any ideas what is going on?

I've tried most of the things in this issue already except Java 12. Is this the fix? If so, I'd suggest not claiming to support Java 11 in repo README, as this is the default version for Ubuntu 18.04 using the package manager (and everyone on Ubuntu will try this first).

nicorellius commented 4 years ago

Installed Java 13 with the following:

sudo apt -y update
sudo add-apt-repository ppa:linuxuprising/java
sudo apt -y update
sudo apt -y install oracle-java13-installer

Then downloaded validator ZIP, unpacked it, then ran the following command (from this thread above):

java -Xms2048m -cp .\lib -jar mzIdentMLValidator-1.4.35-SNAPSHOT.jar

and the GUI launched and I'm validating an mzIdentML file.

ypriverol commented 1 year ago

In the new implementation https://github.com/ypriverol/mzidentml-validator all dependencies are packaged within the same tool jar. I will close this issue unless someone has major complains and wants to open it again.