Giter Club home page Giter Club logo

Comments (7)

Eugene-Mark avatar Eugene-Mark commented on July 18, 2024

@swegs I have fixed the bug, please try with release 1.1.1.

I guess it's because the entry class org.eugene.App extends other class which is described here:
https://stackoverflow.com/a/38133937/3378204

I got this error using Maven, and I discovered the solution.

Error: Could not find or load main class com.mycompany.testapifactory.Main

I'm using java JDK version 1.7 on Linux, my pom.xml file was the default generated by Netbeans and I was using these commands to compile, which do work fine with a normal hello-world java application:

mvn clean compile
java -jar target/TestAPIFactory-1.0-SNAPSHOT.jar com.mycompany.testapifactory.Main

What happened:

It turns out my problem was that my Main method was extending something Exotic like this:

public class Main extends SomeExoticLibraryClass{
    public static void main(String[] args){
        //...
    }
}

It was this extending of the main class that caused the above error.

TLDR solution:

Make sure your main class isn't extending any 3rd party classes. Refactor those out and away into their own classes. That error message is awful, and requires process of elimination to find out what to do.

from bigdata-file-viewer.

swegs avatar swegs commented on July 18, 2024

Tried your new version and now I'm getting

Computer:Downloads $ java -jar BigdataFileViewer-1.1.1-SNAPSHOT-jar-with-dependencies.jar Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at org.eugene.App.main(App.java:13) Caused by: java.lang.ClassNotFoundException: javafx.application.Application at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 10 more

from bigdata-file-viewer.

Eugene-Mark avatar Eugene-Mark commented on July 18, 2024

@swegs Thanks for your comment. At least we saw the progress we made, the main entry is not invisible now.

And for your current issue, the javaFX library is missed on your environment as mentioned in README.txt.

Make sure the Java has javafx bound. For example, I installed openjdk 1.8 on Ubuntu 18.04 and it has no javafx bound, I installed it following guide here [https://stackoverflow.com/questions/56166267/how-do-i-get-java-fx-running-with-openjdk-8-on-ubuntu-18-04-2-lts/56166582#56166582].

The javaFX library is not always in the java package and it depends version by version.
I'm afraid you need to install the javaFX library and put it to your local system.

from bigdata-file-viewer.

Eugene-Mark avatar Eugene-Mark commented on July 18, 2024

@swegs There is a similar thread https://stackoverflow.com/questions/58426650/how-to-create-javafx-programs-in-jdk-13.
The javafx library is removed in java11 and I guess the higher version java13 also doesn't have javafx bound.
I suggest you to install javafx library to your MAC or just installed multiple java on your machine. You can switch java version by setting the environment variable on your local machine.

from bigdata-file-viewer.

swegs avatar swegs commented on July 18, 2024

Thanks for the help.

from bigdata-file-viewer.

swegs avatar swegs commented on July 18, 2024

Thought I'd follow up on this a little bit with instructions I used to resolve my issue.

  1. Downloaded and unziped the JavaFX SDK (I went with version 11.0.2) from here
  2. Ran export PATH_TO_FX=path/to/javafx-sdk-11.0.2/lib
  3. Finally ran java --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml -jar BigdataFileViewer-1.2.1-SNAPSHOT-jar-with-dependencies.jar

from bigdata-file-viewer.

Eugene-Mark avatar Eugene-Mark commented on July 18, 2024

@swegs Good summary, thanks for this follow up. These instructions might help others who run into same situation.

from bigdata-file-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.