Just set the path variable to JDK bin in environment variables.
Variable Name : PATH
Variable Value : C:\Program Files\Java\jdk1.8.0_31\bin
But the best practice is to set JAVA_HOME and PATH as follow.
Variable Name : JAVA_HOME
Variable Value : C:\Program Files\Java\jdk1.8.0_31
Variable Name : PATH
Variable Value : %JAVA_HOME%\bin
Related Contents:
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- How can I set my Cygwin PATH to find javac?
- Why does array[idx++]+=”a” increase idx once in Java 8 but twice in Java 9 and 10?
- How to get the path of a running JAR file?
- Error:java: invalid source release: 8 in Intellij. What does it mean?
- Recommended way to get hostname in Java
- How to construct a relative path in Java from two absolute paths (or URLs)?
- Get java.nio.file.Path object from java.io.File
- Why does a Java class compile differently with a blank line?
- What is the difference between javac and the Eclipse compiler?
- How to test code dependent on environment variables using JUnit?
- Check if a path represents a file or a folder
- javac option to compile all java files under a given directory recursively
- Does Java have a path joining method? [duplicate]
- Ant path style patterns
- Environment variable to control java.io.tmpdir?
- javac error: Class names are only accepted if annotation processing is explicitly requested
- What is the –release flag in the Java 9 compiler?
- How to set environment variable or system property in spring tests?
- Environment Variable with Maven
- How to get current working directory in Java?
- How to check the extension of a Java 7 Path
- Java: How can I compile an entire directory structure of code ?
- Optimization by Java Compiler
- Read environment variable in SpringBoot
- How to access a sub-file/folder in Java 7 java.nio.file.Path?
- javac command line compile error: package javax.servlet does not exist
- Unable to locate an executable at “/usr/bin/java/bin/java” (-1)
- When to use ** (double star) in glob syntax within JAVA
- How to give environmental variable path for file appender in configuration file in log4j
- Installing Android Studio, does not point to a valid JVM installation error
- How to compile multiple java source files in command line
- InputStream from relative path
- What is LD_LIBRARY_PATH and how to use it?
- Convert URL to normal windows filename Java
- Suppress javac warning “…is internal proprietary API and may be removed in a future release”
- Difference in behaviour of the ternary operator on JDK8 and JDK10
- is it possible to disable javac’s inlining of static final variables?
- define ant property from environment with default value
- How to add a folder to `Path` environment variable in Windows 10 (with screenshots)
- Eclipse will not open due to environment variables [duplicate]
- Why does the Java compiler 11 use invokevirtual to call private methods?
- Why does javac allow some impossible casts and not others?
- “The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe”
- Using system environment variables in log4j xml configuration
- Regarding application.properties file and environment variable
- How do I set -Dfile.encoding within ant’s build.xml?
- what’s the difference between -source and -target compatibility?
- Converting Relative Paths to Absolute Paths
- What’s the difference between a System property and environment variable