I'm using Windows 10, JDK 10.0.1.
I'm trying to compile a program using the command line but whenever I try to specify javac it does not work. It will say one of two messages depending on the method.
Method 1
Using the JAVA_HOME method, I'll type javac Example.java
in the command line and it will say:
'javac' is not recognized as an internal or external command,
operable program or batch file.
Path Setup for Method #1: https://gyazo.com/3503ef29c48175385768d8cd9b068ce4
Method 2 Using the direct Java bin path method:
C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;
The output will be:
javac: file not found: Example.java
Usage: javac <options> <source files>
use --help for a list of possible options
Path Setup for Method #2: In the Environment Variables -> System variables I've tried to add the Java bin path to the "Path" variable. I tried adding "C:\Program Files\Java\jdk-10.0.1\bin" at the front and end of the path like so:
- Front: https://gyazo.com/22d4e4ac35a34af5d1333b74e7c16c88
- End: https://gyazo.com/f066abbd45a5f16f4c49232890263299
Sources: