0

i have been using eclipse, mars, neon and oxygen and i always had the same problem after some days/weeks of using its.

When i press run. It sometimes likes not to work and with no reason scream

Error: Could not find or load main class test.PingSwitchPing

and sometimes after i press run a few more times it suddenly works...

other times when i make some changes to code eclipse doesn't compile to make changes and run old code...

this time it is giving me something that it can't even replicate right now so i cant show error message, but basically the error was about not seeing class path to external libraries and to other parts of code that where in diffrent folder. While it was in phase on loading javafx application.

Why is it so unstable ? it is really piss me off becouse sometimes i am loosing hours to fight with it...

Sometimes i remove .m2 folder and redonwload everyting and it is helping. Cleaning project do nothing to this.

Sometimes restarting pc and eclipse works other times it dosen't...

I was just writing that i can't replicate main error but when i changed on line of code and run then it occurs. When i change it back nothing change. it still dosent work and dont want to work...

    Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.NullPointerException
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    ... 5 more
java.lang.NoClassDefFoundError: org/quartz/SchedulerException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$155(LauncherImpl.java:352)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.quartz.SchedulerException
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 11 more

It once even let me write this

scene.getStylesheets().add("My.css");

and it worked event when this file was in .../workspace

when project was in .../workspace/MavenProjectName

It is just so unrelabile...

Adrian
  • 149
  • 3
  • 16
  • 1
    If a project has strange errors, I always try building it with "clean install" and then using ALT+F5. In most cases, the errors are gone after this. – J Fabian Meier Jan 11 '18 at 15:42
  • I noticed that i dont have maven in external tools it disapires. Can that be the cause ? – Adrian Jan 11 '18 at 15:50
  • Whenever it occurs, look for the PingSwitchPing.class file on your file system. This is likely not an Eclipse problem. Either the file is not being compiled for some reason or other (check your compile errors), or for some other reason it is not being found. Yes, it is possible that if maven is failing to retrieve a dependency, then the file will no longer compile. – Sean F Jan 11 '18 at 16:21
  • Have you tried launching eclipse using the '-clean' option? Cleaning cached data may help when eclipse starts behaving oddly for no reason. See https://stackoverflow.com/questions/2030064/how-to-run-eclipse-in-clean-mode-and-what-happens-if-we-do-so – stepan Jan 11 '18 at 21:45
  • Starting Eclipse with clean option resolved all problems. Thanks! – Adrian Jan 12 '18 at 11:40
  • Ok so, the clean options helped but not for long. Eclipse just dont want to reompile classes. Even when i remove old one from target folder. It still run the old code from god knows where! – Adrian Jan 15 '18 at 14:18

0 Answers0