Java passes at the command prompt, but javac does not

I wanted to study an object-oriented language and tried to put Java in Windows. However, java passed, but javac did not.

$ javac
'javac'Is an internal or external command,
It is not recognized as an operable program or batch file.

When I check the folder where java.exe is installed It was written as "jre".

C:\Program Files (x86)\Java\jre1.8.0_191\bin

Therefore, I investigated jre by referring to the following site. https://furien.jp/columns/227/

According to this site Because jre ("Java Runtime Environment") is for running java I found that I couldn't write a program.

On the other hand If you install something called jdk ("Java Development Kit") It turns out that java can be developed.

Therefore, I reinstalled jdk according to the following article. https://eng-entrance.com/java-install-jdk-windows

Try compiling hello.java and running it.

hello.java


public class hello{
  public static void main(String[] args){
    System.out.print("Hello");
  }
}

I typed the following at the command prompt:

$ javac hello.java
$ java hello
Hello

As a result, it was executed normally. Congratulations. (It's short, but I'm sorry)

Recommended Posts

Java passes at the command prompt, but javac does not
Compile Java at the command prompt
The problem that the JDK set in JAVA_HOME does not appear even if java -version is performed at the command prompt
[CentOS8] Since the javac command could not be used, install the java development environment.
[Java] com.sun.glass.WindowEvent is imported and the window does not close
When a Java file created with the Atom editor is garbled when executed at the command prompt
OpenJDK 8 java and javac command help
javac, jar, java command cheat sheet
Java Integer comparison (==) does not work correctly