I have the JDK 10.0.2 installed, have the cmd opened in the folder of the class files of my program and try the command: javap Simulation.class . I get the error that the command javap is not found. What do I do wrong?
3 Answers
You must have your $JAVA_HOME/bin
directory added to system PATH
for javap
command to be available without it's absolute path.
Alternatively you can call javap
using the absolute path:
/usr/lib/.../bin/javap Simulation.class
![](../../users/profiles/1602555.webp)
- 38,744
- 9
- 58
- 89
append $JAVA_HOME/bin to system $PATH variable. for example on linux
JAVA_HOME= "path of java installation on system"
export PATH = $JAVA_HOME/bin:$PATH
![](../../users/profiles/2853439.webp)
- 1,973
- 2
- 23
- 37
Assuming you are on Windows, check in your environment variable PATH whether path to Java executables is set. Ex. If you have installed Java on path,say, C:\Program Files\Java\jdk-10 Then you have to add C:\Program Files\Java\jdk-10\bin to your PATH environment variable to be able to execute java commands from anywhere on command line.
References for Oracle Docs
- https://docs.oracle.com/javase/10/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-DAF345BA-B3E7-4CF2-B87A-B6662D691840
- https://www.java.com/en/download/help/path.xml
On a sidenote, recommend you to move to Java 11 now that Java 10 is no longer supported. The above instructions would still remain same.
![](../../users/profiles/3156219.webp)
- 27
- 6