Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoey Kao
15,875 PointsCannot run the JavaFX program on the terminal, but it run well on intelliJ.
I am trying to create a JavaFX program. The program run well on intellij. However, when I try to execute “Main.class” on the terminal. I get a NoClassDefFoundError. Can anyone help solve the problem. Thanks!!
My operating system is OS X. My intelliJ version is 15.
Joey Kao
15,875 PointsHi Jiří , Thank you for your reply!! In the class path "src com.treehouse.Main", Does the src means the upper directory and "com.treehouse" the packages?
2 Answers
Jiří Kolařík
9,373 PointsYes, "src" is file path where is starting your folder with JAVA packages in your project. The next is path in java package's syntax to main class of project e.g."src com.treehouse.Main". In this example it is run file in file system path: ./src/com/treehouse/Main.class
Joey Kao
15,875 PointsHi Jiří, thank you soooooo much!!
Jiří Kolařík
9,373 PointsJiří Kolařík
9,373 PointsYou need use command java with parametrs: "cp", information about source floder "src" and information about main package. e.g.: java -cp src com.treehouse.Main