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 messageGo to next 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...
Re: java.lang.NoClassDefFoundError only on Mac OS [message #1772521 is a reply to message #1753824] Mon, 11 September 2017 23:20 Go to previous message
youssef chlih is currently offline youssef chlihFriend
Messages: 1
Registered: September 2017
Junior Member
I'm encountring the same issue, I have a JavaFX test that runs successfully in OSX but fails in windows throwing the exception : java.lang.RuntimeException: Internal graphics not initialized yet.

But when I add new JFXPanel(); to initialize JavaFX environment as many threads suggest, then test started failing at OSX and running successfully in windows.

No solution seems to be working, did you find any solution ?
Previous Topic:e(fx)clipse 3.0.0 released
Next Topic:Testing FXCanvas with SWTBot
Goto Forum:
  


Current Time: Mon Oct 23 04:46:07 GMT 2017

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

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