How to convert the type of the file from JAR to Executable Jar file.
Thanks&Regards,
Anantharamulu.
Solved! Go to Solution.
Views
Replies
Total Likes
hi @Anantharamulu_G ,
You can convert a regular JAR file into an executable JAR file by following these steps:
1. Create a file named MANIFEST.MF in the same directory as your JAR file. Add the following contents to the file:
Manifest-Version: 1.0
Main-Class: com.example.MainClass
2. Open a command prompt or terminal window.Navigate to the directory containing your JAR file and the MANIFEST.MF file and Run the following command:
jar cfm myapp.jar MANIFEST.MF com/example/*.class
3. To test the executable JAR file, Run the following command to start your application:
java -jar myapp.jar
hi @Anantharamulu_G ,
You can convert a regular JAR file into an executable JAR file by following these steps:
1. Create a file named MANIFEST.MF in the same directory as your JAR file. Add the following contents to the file:
Manifest-Version: 1.0
Main-Class: com.example.MainClass
2. Open a command prompt or terminal window.Navigate to the directory containing your JAR file and the MANIFEST.MF file and Run the following command:
jar cfm myapp.jar MANIFEST.MF com/example/*.class
3. To test the executable JAR file, Run the following command to start your application:
java -jar myapp.jar
Hi @Anantharamulu_G ,
I think you are facing some issues with opening this JAR, it is executable by default. the problem here seems to be here ".jar" in your filename. Could you try after removing it?
I have seen this problem on Windows, where sometimes adding an extension makes it unusable. (Check you view setting of windows).
Also, try to open this file using the command prompt using
java -jar <youraemjar>
Hope this helps!
Regards,
Nitesh
Try
Right-click the .jar file >> click Properties >> In the general tab, click Change besides open with: >> click More Apps >> scroll down, click Look for another app on the PC >> browse to Java installation directory > bin > select "javaw"
Views
Likes
Replies