3

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?

Temerita
  • 91
  • 2
  • 7
  • You have to set the path/environment variable. please see: https://stackoverflow.com/questions/1672281/environment-variables-for-java-installation – Chris Nov 23 '18 at 10:39

3 Answers3

2

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
Karol Dowbecki
  • 38,744
  • 9
  • 58
  • 89
1

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
Prateek Jain
  • 1,973
  • 2
  • 23
  • 37
1

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

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.