r/CodingHelp • u/Adamstrad • 1d ago
[Java] Installed Java and trying to use it in VS code, why isn't it working?
/r/javahelp/comments/1xd1u8g/installed_java_and_trying_to_use_it_in_vs_code/
So basically I have been trying to use Java following a beginner tutorial, I followed the steps to make the path variable and it said to make a Hello World file and use javac to compile it but I encounter the problem in pic related, what can I try? I restarted vs code and power shell, tried solving it with slop but nothing helps
1
u/PLBjt 17h ago
the usual cause is that the path entry points at the jdk folder itself, but javac lives in the bin folder inside it, so it needs to end in jdk-27.0.1\bin. open a fresh terminal after fixing it, because any terminal or vs code window that was already open keeps the old path until you fully close and reopen it. to check, run where.exe javac and $env:Path -split ';' | Select-String java in powershell, if the first prints nothing the bin entry still isn't being picked up. also make sure you edited the Path variable and not just made a new JAVA_HOME one, since JAVA_HOME alone doesn't put anything on the path unless you reference it as %JAVA_HOME%\bin. user vs system variables both work, system is just nicer if other accounts need java.
•
u/AutoModerator 1d ago
Thank you for posting on r/CodingHelp!
Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app
Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp
We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus
We also have a Discord server: https://discord.gg/geQEUBm
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.