This question already has answers here:
How to create a Jar file in Netbeans
(4 answers)
Closed 9 years ago.
I created a java project using netbeansIDE. Now I want to convert it into an .exe file, but I need to convert the java project into a .jar file first, since java project can't be compiled into a .exe file directly it can be only be converted to exe from jar file. So how shall I convert java project into a .jar file. Please answer in detail since I am a beginer in java programing.
Thank You.
If you are using Netbeans IDE then you can easily build a jar file of your project.
Just go to Run in the Menu above and select clean and build.
Now goto to you project folder, find Dist folder inside it and there you have your .jar file.
Related
This question already has answers here:
How can I convert my Java program to an .exe file?
(16 answers)
Closed 7 years ago.
I am new for java. As a first step, I made a simple calculator in NetBeans.
I wanted to make it an executable software and to run it just by double clicking it as on visual basic.
Please tell me if you know a method to do that.
I don't know your IDE but you need to export an as executable jar file. Then you can run that.
In Eclipse:
File > Export > Runnable Jar File > Choose your path > Click export
Right click on the project -> Clean and build
You can find the runnable jar in your project folder > dist (newly created folder)
This question already has answers here:
Whats best way to package a Java Application with lots of dependencies?
(7 answers)
Executable Jar with depedencies
(5 answers)
Closed 7 years ago.
I made my first application with Java in Eclipse now I need to repackage or create an executable file file from that project. I used a lot of external jar libraries that I would like to export whit the project. Any solution is welcome.
I suggest to use apache maven to make a fat jar in conjunction with the launch4j maven plugin to make an self-contained exe (i.e. a wrapper for the jar).
you can make a executable jar file of that project. And then make a .bat file. From that .bat file you can invoke that executable jar.
Eclipse will pack you yourprojectname.jar file, which is executable file. So, in order to run it you may just run in command line (a.k.a cmd) java -jar path/to/your/project.jar. And of course it is more easier to run it with script. There are .bat files which are something like .bash scripts in linux/unix
Right click on your Eclipse project in ProjectExplorer
Export...
Java\Runnable jar file
On dialog Runnable JAR file export
4.1. Choose the main() method you need to start from the popup "Launch configuration"
4.2. Specify the output jar like: d:\dest.jar
4.3. "Finish'
This question already has answers here:
Eclipse exported Runnable JAR not showing images
(8 answers)
Closed 7 years ago.
I'm trying to export my java file as a runnable .jar file using Eclipse. The procedure I'm doing is:
File > Export > Java > Runnable .jar, and my options are as follows:
http://gyazo.com/88ad22e9382e964e47a1a21200ff0f4b
My problem is, when I run the file in Eclipse, any imported pictures (e.g. a logo for the GUI application) shows up, but it doesn't show up in the exported .jar file.
I.e:
http://gyazo.com/4092e8756f4054ce00429d50c33c22af - in Eclipse
http://gyazo.com/7309d84f64832b22560ef023c9349a52 - running the .jar file
My images are in a folder called filesrc which is in the same folder as my project, as can be shown here:
http://gyazo.com/20f8191ee173e06638811c237f985c6f
What am I doing wrong? How can I make these images appear in the .jar?
Thanks
Make sure your exported .jar file contains the folder with your images. So lets assume that your images are in a folder called \images at the root of your JAR file.
In your code, you need to change the way your are getting these images to :
Toolkit.getDefaultToolkit().getImage(getClass().getResource("/images/plus.png"));
This question already has an answer here:
How to export an Eclipse Project with External Jar dependencies?
(1 answer)
Closed 8 years ago.
I have developed a program that includes external jars also. Now I need to convert this program to a runnable jar (It has main method) and place it another location.
But how to include the external dependencies along with this conversion . I dont want other to download the external jars again and again.
Regards,
Siva
Right click on your project then go to Export -> Java -> Runnable JAR File and there select Package Required libraries into generated JAR radio box
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I convert my Java program to an .exe file?
I have Java project and will making a setup file to my project. İn my procet I have a jar file which runs my project. whan can I do to create a setup file to my Netbeans Java Project
There are software convert from jar to exe like JAR2EXE but it's not setup file
Check out Launch4J which will create an Windows executable from a Java JAR file.