0

I am unable to to get my already complied and saved .java file will not be complied in the cmd and it will not allow me to create a .jar file because the terminal is telling me'jar' is not a recognized as an internal or external command, operable program or batch file. it gives me the same output when i try the javac command to compile.

I need to create the .jar in order to continue in creating an .exe correct? or is there another way?

Im also working in drJava which might be an issue but i dont know?

user1469139
  • 13
  • 1
  • 9

1 Answers1

1

The <JDK_HOME>\bin directory should be in your PATH environment variable:

set PATH=c:\java\jdk_xx\bin;%PATH%

And you won't be able to create a .exe file. Java programs are launched using the java command.

This should be covered by the first chapter of your Java book or tutorial. Read it.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • 1
    I have read it and i did what you said however it still is not working – user1469139 Jul 03 '12 at 20:13
  • Edit your question and explain where your JDK is installed, the exact sequence of commands you executed, and the exact output it gave. – JB Nizet Jul 03 '12 at 20:16
  • I'm having the same problem. Does the jar command require a separate path variable, because I am able to use the java and javac commands without issue, but I get the error message posted above when I try to create a jar file using the jar command. – qwerty Feb 03 '21 at 00:07