0
votes

I've set the path exactly as I have seen multiple people on tutorials, but maybe that's my problem. I executed echo %path% and got this:

C:\Users\Desktop>echo %path% "C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin";"C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin";C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;"C:\Users\Desktop\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk\bin\javac.exe";

Please can someone point out what I should do? I just want to compile java in the command prompt

1
I don't really understand what the initial problem is. Sure enough you have some oddly placed " (quotes). Try removing all " from your pathPilouPili
Your path should include the directory containing commands, i.e. C:\Program Files\Java\jdk\bin, not the command itself (javac.exe).Holger

1 Answers

0
votes

I resolved the problem. I could not compile java programs within the command prompt.

I went into the Advance System Settings and in Variables I opened the path on the upper prompt and deleted the other paths I had attempted to add to existing paths with ';' While this method may work it did not for me. I opened File Explorer, then this pc, then c:, then program files, then Java, then JDK, then bin, then I highlighted the address bar and copied it. I went back to the Variables in the Advance System Settings and added a new path within the prompt that is on top pasted the address and saved and hit okay jumped back into the command prompt and typed in javac and voila it worked. ready to start programming in the command prompt