JAVA command shows nothing in a command prompt

Viewed 720

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?

2 Answers

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.

Check you environment variables. Sometimes if your upgrade Java, the directory of your Java installation changes, but doesn't get updated in the environment variables. You'll you have to manual update them by correcting where they point to.

Related