java file compilation using cmd( javac ) | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

java file compilation using cmd( javac )

Recently my teacher demonstrated how to compile ".Java" file using cmd. But when I tried to compile using "javac Hello.java"(name I kept for the file btw) I got "javac is not recognized as Internal or external command".Then I saw YouTube videos and added path in Environment variable as said I YouTube, but still I got the same error. Later I found there is no "javac.exe" file inside bin. I have installed Java version "18.8.0_301".

19th Aug 2021, 6:38 AM
White Demon
White Demon - avatar
3 Antworten
+ 2
Its all explained in detail on the official site. After installing JDK you need to add <jdkPath>/bin to the PATH environment variable, that will let you type javac in cmd without specifying the absolute path to it. Make sure to restart cmd after so it reads the new PATH variable. https://docs.oracle.com/en/java/javase/16/install/installation-jdk-microsoft-windows-platforms.html#GUID-96EB3876-8C7A-4A25-9F3A-A2983FEC016A
19th Aug 2021, 8:30 AM
Giorgos
+ 1
Ho thank you so I need to download and install JDK pack right?
19th Aug 2021, 2:17 PM
White Demon
White Demon - avatar
0
Thanks but what's JDK?
19th Aug 2021, 8:34 AM
White Demon
White Demon - avatar