Skip to content
Advertisement

JAVA command shows nothing in a command prompt

My question is very simple but I still cannot find out what’s the problem. When I input java, java -version or javac -version in a command prompt nothing is shown at all: neither an “unknown file” error nor the result.

That’s how it looks like:

nothing is shown picture

I used standard Java installer, PATH and JAVA_HOME variables were renewed. I’ve set JDKs several times before but it’s the first time I run into such a problem. Is there anything I am missing or is it a known bug?

Advertisement

Answer

I have seen this occasionally on Windows, and uninstalling all Java distributions (those with an installer) and reinstalling the one you need usually fixes it for me.

If you do a lot of Java development you may need to have several versions of Java available on your system to be sure that everything is compatible for a given project. In that case, ZIP distributions that just need to be unpacked and not installed are very handy, especially with a good IDE that just needs to be told where to find them.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement