Main-Class not found

  • lowecg
Posted: Wed, 06/16/2010 - 00:58

Following a recent plugin update, I can no longer launch my JFX app from Eclipse, I just get the following:

Main-Class not found app.Main

java.lang.ClassNotFoundException: app.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.javafx.runtime.Main.main(Main.java:68)

I'm currently using version 1.3.2.N104 of the plugin. Has anything changed or is there anything special that I need to do in order to run an app?

Cheers,

Chris.

Please, check Launch

  • abratukhin
  • 02/18/10
  • Wed, 06/16/2010 - 09:34

Please, check Launch Configuration parameters for your applications.

Thanks for the reply. My

  • lowecg
  • 03/16/10
  • Thu, 06/17/2010 - 00:57

Thanks for the reply.

My launch config appears normal: using my default JFX client + desktop config. Stage refers to the correct JFX file. Initially I saw that the actual project was missing from the classpath, but it made no difference when I added it.

Is there anything in particular that I should be looking for?

Cheers,

Chris.

Do you have multi-module

  • abratukhin
  • 02/18/10
  • Thu, 06/17/2010 - 10:50

Do you have multi-module project? Do you have some dependencies for external jars?

Refresh/Rebuild bug?

  • rcc
  • 08/02/10
  • Mon, 08/02/2010 - 04:55

I've gotten this error multiple times in the past week and have been able to fix it each time with a wretched work-around. My project source code is split into separate directories (src/main, target/src), which seems to be the cause of the troubles. Initially, I have no Eclipse-recognized compiler errors, but attempting to run the app yields the Main-Class not found error. I open my main script and make cosmetic adjustments and re-save. I get compiler errors in my main script for references to objects that are defined in the target folder. Open each of those files, make cosmetic adjustments, re-save, and the main script errors are resolved, but I get some new compiler errors for references to objects in the main folder. Repeat ad nauseam and the compiler errors are no more.

Once everything has been 'refreshed' this way, the app runs with no errors.