Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

java.lang.NoClassDefFoundError: javafx/application/Application in Eclipse IDE

 
Greenhorn
Posts: 23
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Not sure how much or what information to include but here goes:

I am trying to learn Java. I just started working through this online textbook http://math.hws.edu/javanotes/index.html. I am trying to run one of the sample GUI programs (GUIDemo, section 1.6) in the Eclipse IDE, but even after following all the instructions in section 2.6, I am getting this error: java.lang.NoClassDefFoundError: javafx/application/Application. I don't even know where to start to fix the issue. Help!

Thanks in advance

SOLVED - I switched to BlueJ since I'm really new and the program runs with no errors.
 
Rancher
Posts: 259
13
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it looks like you will need to install the javaFX api. it used to come bundled with java but now you need to set it up as a 3rd party api.

https://openjfx.io/
https://gluonhq.com/products/javafx/
 
Khayla Matthews
Greenhorn
Posts: 23
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. I have already downloaded the JavaFX sdk and set up Eclipse to read such files. It's just when I go to actually run the program, I get that error. I'll keep searching. Thanks again.
 
Sheriff
Posts: 7113
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't particularly like the way this professor suggests to setup JavaFX, but let's go with it for now.

Note how he (she?) sets up the JRE in Eclipse:

Now in general, we don't like screenshots, but in this case could you post a screenshot of your JRE setup?  Also, copy and paste the entire error message you get when you run your program.
 
No, tomorrow we rule the world! With this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic