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