Question:
Creating a Jar executable java program?
Digital Football
2013-03-21 11:59:33 UTC
Hi,

I created a simple quiz program which includes audio MP3 files and image JPG files. Most importantly I used an external package in order to play audio files (JavaFX package) to the quiz program. I've used JGrasp IDE to write the program in.

I have tried to then create a jar file from the command line using the 'jar' command. Although before I used javaFX, the jar file could run perfectly on the system without the IDE. But now with the javaFX external package included, after created the jar file, and compiling the file, I get an exception saying cannot find the classes used in javaFX?

I also tried to add the jar files that my IDE has worked with to compile the classes within javaFX, but still gives that exception when I try to compile the jar file (using command ' java -jar quiz.jar ') ?

Can anyone tell how to add the javaFX external package to the jar file in order to run successfully on the system?

Thanks, much appreciated
Four answers:
John
2013-03-21 12:07:18 UTC
I would suggest using an IDE called "Eclipse." It is very simple, and easy to use, and generates a jar when you export the files.
deonejuan
2013-03-21 12:23:26 UTC
May be that an IDE, Eclipse or NetBeans, can build the distribution .jar. JavaFX is still beta with the majority of the working features having been done for the Windows platforms. JavaFX before version 2.0 was all bytecode but now FX requires the FX-plug-in.



So, it may be the IDE can link everything into a .jar, but I wouldn't be surprised about the FX plug-in holding you back. I could be wrong about the plug-in, but I was cranking FX code and loving it before the 2.1 version which has minimum hardware limitations.
anonymous
2016-10-06 04:45:20 UTC
ive performed Java slightly, greater C++, yet I nonetheless did slightly Java. I havent performed NetBeans in a mutually as, yet as quickly as I remeber magnificent, it quite is on the Linux version if there's a distinction, you are able to bypass to record > Run application, and than it may run. yet whilst thats not what you elect bypass to the command line foo@bar~$ chmod a+x foo.jar of direction you are able to interchange foo.jar with the call of the record. the chmod a+x will upload the executable bit to the record and than you are able to execute it. it may not artwork, yet its properly worth a shot. If that doesnt artwork than use a similar command different than replace a+x with a-x and which will get rid of the executable bit.
L
2013-03-21 19:58:35 UTC
sorry but this the the best answer i could come up with,

use Netbeans or Eclipse, you shouldn't encounter those problems in them


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...