-->

Welcome to our Coding with python Page!!! hier you find various code with PHP, Python, AI, Cyber, etc ... Electricity, Energy, Nuclear Power

Tuesday, 3 July 2018

Java | How to convert Java file into executables

Previously I have told that learning Java is a magic. Wanna learn more in that magic? Here’s the easy explanation on converting .java file to .exe.

Steps for exporting .jar from .java

Step 1: Create your java file. I recommend you to create your file in eclipse because creating .jar file for your program can be easily done in that. If you do not have eclipse installed in your system, you can find it in here.
Step 2: Now create your project on eclipse and store it in your workspace.
Step 3: Now right click on your project in Project Explorer tab and select Export.
Export.png
Step 4: In Export -> under JAVA folder select jar file and click next.
export tab.png
Step 5: Select the export destination for your .jar file and click Finish
savingfile.png
Steps for creating an executable
Step 1: You should download a setup of JSmooth to your system. You will find it in here.
Step 2: Open JSmooth after instaling in your system.
jsmooth front.png
Step 3: On Skeleton tab, under Skeleton Selection, select console wrapper option from dropdown list to show my console window as output in my application. You also have other suitable options that can be chosen. Under Skeleton Properties, type the message in the text box that shows when an error occurs(mostly when the client doesn’t own a machine where Java installed). Check PressKey checkbox to make the message to stay in the screen until any key is pressed.
jsmooth skeleton.png
Step 4: On Executable tab, Give you Application Name under Executable Binary text box and Give your Application Icon under Executable Icon.
jsmooth executable
Step 5: On Application tab, under Main Class text box, give the class name of your Java program. In my case, it is “Strdisplay“. Check Use an embedded jar check box under Embedded Settings and direct it to your exported .jar file at the beginning.
Jsmooth Application.png
Step 6: Now, Click the gear icon at the top to compile. Save your Jsmooth file with a good name.
jsmooth save
Once, you have compiled successfully, you get compilation dialog box as follows,
jsmooth compilation
Step 7: After a successful compilation you can see an application exists near your Jsmooth file. Double click it and enjoy the execution.
jsmooth output.PNG

That’s it. now you can able to develop executable applications in Java. If you want to know how to develop executables in python, click here. Also Catch up Cheat sheets that are available in our blog. You can catch them under our blog category ‘Java‘.

No comments:

Post a Comment

Thanks for your comments

Rank

seo