New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting fails with "Could not find or load main class" #88

Closed
ctron opened this Issue Jul 8, 2016 · 12 comments

Comments

Projects
None yet
2 participants
@ctron

ctron commented Jul 8, 2016

Starting the client on Linux (RHEL 7) fails with:

$ java -jar mqtt-spy-0.5.2-jar-with-dependencies.jar 
Error: Could not find or load main class pl.baczkowicz.mqttspy.Main
@kamilfb

This comment has been minimized.

Owner

kamilfb commented Jul 8, 2016

Hi. What version of java are you on?

@ctron

This comment has been minimized.

ctron commented Jul 8, 2016

1.8.0 Update 91

@ctron

This comment has been minimized.

ctron commented Jul 11, 2016

This is the output of java -version:

openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
@ctron

This comment has been minimized.

ctron commented Jul 11, 2016

This can easily be reproduced by using docker:

$ docker run -ti ubuntu:16.04
docker# apt-get update
docker# apt-get -y install openjdk-8-jre-headless wget
docker# wget https://github.com/kamilfb/mqtt-spy/releases/download/mqtt-spy_v0.5.2/mqtt-spy-0.5.2-jar-with-dependencies.jar
docker# java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
docker# java -jar mqtt-spy-0.5.2-jar-with-dependencies.jar 
Error: Could not find or load main class pl.baczkowicz.mqttspy.Main
@kamilfb

This comment has been minimized.

Owner

kamilfb commented Jul 14, 2016

Thanks for the info, I will look into it...

@kamilfb

This comment has been minimized.

Owner

kamilfb commented Jul 15, 2016

Hi @ctron! Have you tried adding "apt-get install openjfx"? Or using "openjdk-8-jre" or "openjdk-8-jdk" instead of "openjdk-8-jre-headless"?

@kamilfb kamilfb added the question label Jul 15, 2016

@ctron

This comment has been minimized.

ctron commented Jul 16, 2016

I was already using open jdk 8. And I am on RHEL 7, I don't know if there are any additional openjfx packages. However javafx applications work in general.

But using the docker instructions I posted you should be able to test it pretty easily.

@kamilfb

This comment has been minimized.

Owner

kamilfb commented Jul 20, 2016

@ctron, as mentioned before, you are missing openjfx libs - you can install them with the following command:

apt-get install openjfx

@ctron

This comment has been minimized.

ctron commented Jul 21, 2016

You are right! On Ubuntu it seems as if JavaFX was missing. Installing with apt-get worked.

However on RHEL7/CentOS7 there is no package named "openjfx".

@kamilfb

This comment has been minimized.

Owner

kamilfb commented Jul 21, 2016

Cool - I'm glad it worked on Ubuntu :) I don't think RedHat & CentOS fully support openjfx. The only way forward is probably to use the Oracle's JRE/JDK when on RHEL/CentOS. If you hit any more problems, just re-open it or raise a new issue.

@kamilfb kamilfb closed this Jul 21, 2016

@ctron

This comment has been minimized.

ctron commented Jul 21, 2016

Ok, so no luck for me ;-)

But thanks for your help!

@kamilfb

This comment has been minimized.

Owner

kamilfb commented Jul 21, 2016

Why can't you use Oracle's JRE instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment