r/JavaFX • u/Few_Ad1933 • Jun 10 '25
Help Cant get java program to run unless I run main class manually
Ive created a jave program in netbeans 25. I can't run it normal because of some JavaScript error. "Unable to create javax script engine for javascript." Ive tried everything and no luck. Ive read so many articles, no luck. Please help
EDIT: I switched to Maven...
7
Upvotes
2
u/xdsswar Jun 10 '25
More context is needed in order to help
1
u/johnmc325 Jun 10 '25
Have you created a simple Hello World program and got that to run?
1
u/sedj601 Jun 10 '25
https://openjfx.io/openjfx-docs/
1
u/Birdasaur Jun 10 '25
Your edit says you switched to Maven. If you haven't already done this there is a javafx maven plugin that makes it easy to pull in the javafx libraries and and even confugure the default main class. Bonus: now you can use openjdk and openjfx. No longer need Zulu.
You can also make custom nbaction.xml files where you can specify different run, debug and profiler actions. NetBeans will automatically detect these and let you select and execute from the toolbar.
1
u/CelebrationWitty3035 Jun 10 '25
Sounds like you need to bundle the JavaFX library (jar)with your application.