+ 1
.jar files not working
I have some code in Java that I'm trying to turn into an executable file, but no matter what I have researched, watched, or tried, nothing seems to get either the .jar file or the .exe file running. Does anyone know how to fix this?
21 ответ
+ 1
i give up, try to ask a new question but mention that you're using eclipse
0
hello again, sorry for not replying.
as you said there the jar file also isnt running. have you set an entry point for the jar files ?
you can check by opening Manifest.mf in Meta-inf inside the jar. and look for Main-Class
0
Taste
Hi again. How do you do that?
0
use archiver program like, winrar or 7zip to open jar file. then extract that file
0
Taste
What do I do after that?
Also, when I double click MANIFEST.MF in WinRar, it says "How do you want to open this file?"
0
use notepad, its just a textfile.
just to chect that the main class for the jar is defined. its common that jar doesnt have an entry point.
0
Taste
The main class is MyClass, just like in the code itself
0
so its set right ?
then try to run the jar file from the command line/terminal.
java -jar jarfile.jar
0
Taste
I got an error that says "Unable to access jarfile NumGrow.jar"
NumGrow is the name I gave the file
0
it meant the jar corrupted or its not found.
are you sure you're running from same directory as the jar file ?
0
Taste
I ran it from Command Prompt, so going by your words, I assume I had to do it somewhere else?
0
navigate to the target directory inside the command prompt.
like this
cd project/java
0
Taste
I don't understand. Sorry.
0
from the folder use shift right click.
then choose open cmd.
from there a cmd will appear, then run the the jar file.
0
I did it with Windows PowerShell and it works there
0
it should be. just in case if its not
https://stackoverflow.com/questions/28691344/how-to-call-a-java-program-from-powershell
i'm not so familar with powershell
0
Taste
I think it works the same as cmd in this case
0
recompiling maybe ? its strange tbh,
0
I tried exporting the code from the Eclipse IDE as a executable JAR file multiple times and turned them into executable files, but none of them work
0
Taste
Alright. Sorry I was vague