After you install JDK (Java Development Kit), open the properties of your computer,
( +PauseBreakorStart→ControlPanelSystem)andclickAdvancedSystemSettings.
ClickEnvironmentVariables...
ClickNewandcreatethefollowingtwovariables:
CLASSPATH=.;%JAVA_HOME%JAVAHOME=CaminhodoJavainstalado
Aftercreatingthevariables,editthePath
variableandplaceasemicolon(;
)attheendofthevalueandaddthepathofthebin
folderwhereJavawaspreviouslyinstalled:
After setting up these steps, restart your computer to apply the settings, and you can compile your .java
code by simply typing javac
and the name of the .java
file in Windows prompt . And running by reporting java
followed by the previously compiled class.
To make the response documented ...