RPTools/TokenTool

jar does not launch

all-the-good-ones-are-gone opened this issue · 8 comments

Downloaded the jar, as not running Debian based (openSUSE Tumbleweed)

java -jar tokentool-2.0.jar run
Error: Could not find or load main class net.rptools.tokentool.client.TokenTool

Is Oracle required? Currently using java-1_8_0-openjdk. Should I upgrade to OpenJDK 10 or 11?

It works for me on macOS High Sierra running Java 9:

$ java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
$

Since the JAR is just a zip file, try unzipping it and piping it into grep looking for the class:

$ jar -tvf tokentool-2.0.jar

When I do that, one of the first files printed out is TokenTool.class and that's the one that the error is referring to.

Offhand, I'd say there's something weird with your Java installation.

Or TokenTool 2.0 requires Java 9+.

Probably should go ahead and move to 10 or 11 and try again.

The MANIFEST.MF says this:

Manifest-Version: 1.0
Implementation-Title: tokentool
Target-Compatibility: 1.8
JavaFX-Preloader-Class: net.rptools.tokentool.client.SplashScreenLoade
 r
Implementation-Version: 2.0
Built-By: appveyor
Built-Date: Mon Mar 19 15:47:05 PDT 2018
Source-Compatibility: 1.8
Built-JDK: 1.8.0_162
Implementation-Vendor: RPTools
Main-Class: net.rptools.tokentool.client.TokenTool

So it looks like Java 8 should work, but it would need the JavaFX libraries; he may not have those. But if that were the case, I would expect the error to be that the JFX classes can't be found, not TokenTool. Although it does say, "Cannot find or load", so perhaps it's the JFX dependencies on TokenTool that are causing the problem.

We'll see what he says about his environment and whether he can try Java 9.

That's probably it. Perhaps there is a separate install for the JavaFX libs and OpenJDK?

Replaced the java version:

> java -version
openjdk version "11-internal" 2018-09-25
OpenJDK Runtime Environment (build 11-internal+20-suse-1.1-x8664)
OpenJDK 64-Bit Server VM (build 11-internal+20-suse-1.1-x8664, mixed mode)

Also checked the jar, and find net/rptools/tokentool/client/TokenTool.class (as well as TokenTool$1.class and TokenTool$2.class).

After upgrading, I'm now getting the following:

> java -jar tokentool-2.0.jar 
Error: Could not find or load main class net.rptools.tokentool.client.TokenTool
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

So it sounds like javafx is not installed. However, I'm not finding anything called javafx or javaFX or JavaFX. Is it part of another package?

You’ve probably figured this out by now, but Google says OpenJFX is a sub project of OpenJDK. Where to find it for openSUSE is unknown to me; you’ll need to ask Google yourself, probably including some additional information about your setup.

I’m certainly glad that the error message is more clear when using an updated version of the OpenJDK!

Yeah, I popped on my server and found openjfx in the Debian repos, but it appears that there was a change two years ago to do with a licensing conflict so it's not packaged in the openSUSE repos.

I can either build it myself (but I have no interest getting ant and friends set up again on my machine), maybe find an unofficial repo that has it, or else install Oracle Java.

Thanks All.