I am trying to run a jar file using the C# code below, which always results in “no main manifest attribute” error.
MANIFEST.MF file does not contain the name of the main-class.
Is it possible to run a jar file without the main-class or is there any workaround for this situation ?
The issue is [namespace.to.your.main.Class] is unknown.
I see that this question has been inactive for some time. Have you found a solution for this yet? If so, could you select the answer (using the ✓ icon)? If not, you can also contact techsupport@skyline.be for assistance.
Before trying to launch the jar from C# code, first make sure that you can launch the same command (java.exe -jar xxxx.jar) manually from a command prompt or terminal window. If you can run it from there, you will also be able to launch it from C#.
In this case, I assume the JAR file was not designed to be executed in this way. You'll probably have to work with the author of the jar file to learn how it should be used.
Yes, I tried running the below command to execute the jar file from the command prompt, which also resulted in the same error.
Command: java.exe -jar API-2.5.4-3.jar
Output: no main manifest attribute, in API-2.5.4-3.jar
Could you try executing: java -cp [PATH TO .JAR] [namespace.to.your.main.Class], where you replace the values between [ ]