Java Class Not Found While Debugging and Running JavaFx Eclipse Project

496 Views Asked by At

I have been reading through SO and several pages of google links, tried all of the approaches there but I cannot get my project running any more.

I am developing a small app and i decided to persist some data in JSON. I downloaded javax.json-api-1.1.jar and javax.json-api-1.1-sources.jar. Eclipse finds the jar file, I can import it, intellisense works, etc. Sadly, when running or debugging I get the following error as soon as the first JSON related line is executed:

Caused by: javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found
at javax.json.spi.JsonProvider.provider(JsonProvider.java:99)
at javax.json.Json.createObjectBuilder(Json.java:299)
at tabumaker.view.ChordManagementViewController.handleAddChordSaveBtnOnAction(ChordManagementViewController.java:214)
... 62 more

Caused by: java.lang.ClassNotFoundException: org.glassfish.json.JsonProviderImpl
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)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.json.spi.JsonProvider.provider(JsonProvider.java:96)
... 64 more

I put both jar files within my workspace and linked them in my eclipse project the following way:

Source attached to jar file:

enter image description here

Source-Lookup-Path set in project:

enter image description here

Source-Lookup-Path:

enter image description here

I really have no idea why it doesn't work. Eclipse has all information to find the API and the corresponding sources within those two jar files.

0

There are 0 best solutions below