Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » java.lang.NoClassDefFoundError only on Mac OS(Can't execute JUnit test)
java.lang.NoClassDefFoundError only on Mac OS [message #1753754] Thu, 09 February 2017 16:27 Go to next message
Nemanja Bjelica is currently offline Nemanja BjelicaFriend
Messages: 14
Registered: October 2015
Junior Member
Hi all,

Among other tests in my fragment project, I've created a JUnit test case for comparing two JavaFX images. So I got an error java.lang.RuntimeException: Internal graphics not initialized yet.
I investigated a bit and found couple of threads where adding new JFXPanel(); into the setUpBeforeClass method solves the problem with graphics initialization.

BUT, this works on my Windows 7 machine but not on Mac machine. On Mac I get an error org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javafx/embed/swt/FXCanvas.

I'm running the tests as JUnit Plugin test with
-Dosgi.framework.extensions=org.eclipse.fx.osgi VM argument.

Any help would be much appreciated.
Re: java.lang.NoClassDefFoundError only on Mac OS [message #1753824 is a reply to message #1753754] Fri, 10 February 2017 12:47 Go to previous message
Nemanja Bjelica is currently offline Nemanja BjelicaFriend
Messages: 14
Registered: October 2015
Junior Member
I've managed to run the test as JUnit plug in test, locally on my Mac, which uses JDK 1.8.0_91. Also, when I run the tests using maven's clean install command, tests pass.

Now I have the same error on Jenkins machine which uses JDK 1.8.0_65, tests do not pass when run with clean install command. I've checked for jfxswt.jar and it is present under jre/lib path...
Previous Topic:ClassLoaderHook
Next Topic:Disappointed in e(fx)clipse (and Eclipse.
Goto Forum:
  


Current Time: Sun Aug 20 06:22:56 GMT 2017

Powered by FUDForum. Page generated in 0.03559 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software