Search code examples
javainstallationpathconsolebin

Java does not print anything despite being listed on the PATH


As the title suggests, I am having trouble running any java files from my command line/text editors. While I am able to run and test things on VSCode, anything outside of that does not work. My JAVA_HOME is set up within my System variables as the correct path (D:\Coding\Java\jdk-18) along with adding the bin path (D:\Coding\Java\jdk-18\bin) to the PATH variable. I assume java is on my machine as I do not receive any errors when I run java -version on my command line, however nothing prints.

EDIT: I'm on Windows 10 if that helps with anything


Solution

  • The problem was that there was an older portion of the PATH variable that was taking priority of the java name and caused the lack of printing. Moving up the D:\Coding\Java\jdk-18\bin while also deleting anything that looked like might override the java call was what worked for me.