I have some source files written in java on eclipse IDE.
I'm trying to create an executable file so I can run it on Windows 7.
So I tried to export the project from eclipse and it created a jar file, but when I tried to run it from Windows' command prompt (CMD) with "java -jar myapp.jar" it says "java is not recognized as an internal or external command, operable program or batch file."
At this point I found out I don't have the Java Runtime Environment installed on my PC, so I downloaded, installed it, and reboot my computer, and indeed my .jar file changed its icon to java's icon now (nothing happens when double click it), but I still get the above error when trying to run it from CMD.
What am I doing wrong? are there specific settings that I missed when exported the jar file from Eclipse?
You need to add Java to your PATH.
Windows 7
By "class" it means the JDK/bin or JRE/bin folder
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.