+ 4

How to make a exexutale file (JAVA)

How can we make an executable jar or exe file in java compiling source.java file ? I am using 'Eclipse Java Oxygen IDE' and how compilation of direct executable file on double clicking can be made ?

23rd Oct 2018, 11:18 AM
Googel
Googel - avatar
2 Antworten
+ 5
in eclipse it is very intuitive: right click on project. export. jar. select name and directory. next. seal the packages and select the main class. if you use windows you need a batch file in the same directory like: @echo off java -jar name.jar <parameters> in linux a bash script
23rd Oct 2018, 2:26 PM
SouthPoleHillbilly
SouthPoleHillbilly - avatar
+ 1
I think you cannot make .exe files in java - instead it makes a .class. If you want to make a .exe file write a program in c# and run this script in your windows cmd prompt. csc YOUR_CS_APPNAME That will compile the c# code and make a .exe file
24th Oct 2018, 7:59 AM
Seniru
Seniru - avatar