15
I am trying to compile a java class via command line (cmd), but I cannot, the error shown is:
'java is not recognized as an internal or external command, a operable program, or a batch file.
Screenshot of the prompt with the error:
I set the environment variables as follows:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_60
and
PATH:
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files\Windows Live\Shared;
C:\Users\7\AppData\Local\Smartbar\Application\;
C:\Users\7\AppData\Local\Smartbar\Application\;
C:\Users\7\AppData\Local\Smartbar\Application\;
C:\Program Files\Skype\Phone\
Are you trying to compile from the command line? put the command you executed.
– rray
by cmd , I tried but will not
– Nani Bye
Put the cmd command, the java code is inside some Packge?
– rray
is not in any package
– Nani Bye
What’s the bug? Edit your question and add the bug, and if you find it necessary, the code you made.
– emanuelsn
Nani good afternoon, @rray asked you to ask the question the command and the code you tried to compile, enter this data so that it is possible to understand what the problem is and to be able to help you :) See more.
– Guilherme Nascimento
posted the image
– Nani Bye
Now it’s improved. By the way the environment variables were not configured correctly or the cmd you ran was with the old settings.
– rray
I’ve already configured 4 times the environment variables '-'
– Nani Bye
Edit the question and put their value as text, in the image does not to see JAVA_HOME in PATH.
– rray
ready, but the path modified the change itself '-'
– Nani Bye
At the end of the PATH, add this:
;%JAVA_HOME%
, ok and go confirming, close all cmd, open a new cmd and runjavac
orjava --version
.– rray
when rodei javac was not, and java --version appeared the following message : error: could not to create java virtual machine
– Nani Bye
See this possible solution to this error here.
– Bruno Wego
You installed the JDK for 32bit?
– Guilherme Nascimento