-2

The "java is not recognized as an internal or extenal command." is a fairly common problem. Note that I am not looking for a solution to this. If someone came here for such a solution, it can be found here and on other threads.

My issue is, rather, as follows:

When I install java on a Windows 7 computer without changing the default installation path, java is automatically recognized by CMD. No problem there. I've done this in both, x86 and x64, and across several versions (Starter to Ultimate). However, it has come to my attention, that when I install java on a Windows 8.1 machine, the aforementioned problem is prompted when I try to run a batch file that serves as a "shortcut" to a jar file I created (java -jar ".\a\b\foo.jar") which does run smoothly on Windows 7.

What I am asking here is: why does this happen? Furthermore, is there a certain way I could install java so as to avoid having to modify my PATH variable or tweaking around Windows configuration? I would like to prevent such inconveniences on every Windows 8 & 8.1 machine on which I have to install java.

3
  • Provide an example of this batch file. Because I was able to write a batch file and launch a Java program without a problem on 8.1
    – Ramhound
    Commented Oct 22, 2014 at 15:42
  • @Ramhound: The problem isn't in the batch file, the problem is that java is not configuring "itself" by default to be a command accessible from the CMD, due to the PATH variable and all. Then again, I am NOT searching for a solution to this problem, since it is common. Commented Oct 22, 2014 at 18:12
  • I don't have this problem and I used the default installer; sounds like you don't actually want help with the actual problem; sounds like your asking the wrong question
    – Ramhound
    Commented Oct 22, 2014 at 18:17

1 Answer 1

0

Use short paths and instead of referencing shortcuts, reference original file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .