3

My mother downloaded the newest version of java and now it wont run.

Here is the error message:

[18:15:59 ERROR]: Couldn't launch game
java.io.IOException: Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:\Users\Sarina\AppData\Roaming\.minecraft"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source) ~[?:1.7.0_55]
    at com.mojang.launcher.game.process.direct.DirectGameProcessFactory.startGame(DirectGameProcessFactory.java:14) ~[launcher.jar:?]
    at net.minecraft.launcher.game.MinecraftGameRunner.launchGame(MinecraftGameRunner.java:205) [launcher.jar:?]
    at com.mojang.launcher.game.runner.AbstractGameRunner.onDownloadJobFinished(AbstractGameRunner.java:177) [launcher.jar:?]
    at com.mojang.launcher.updater.download.DownloadJob.popAndDownload(DownloadJob.java:122) [launcher.jar:?]
    at com.mojang.launcher.updater.download.DownloadJob.access$000(DownloadJob.java:12) [launcher.jar:?]
    at com.mojang.launcher.updater.download.DownloadJob$1.run(DownloadJob.java:86) [launcher.jar:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_55]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_55]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_55]
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method) ~[?:1.7.0_55]
    at java.lang.ProcessImpl.<init>(Unknown Source) ~[?:1.7.0_55]
    at java.lang.ProcessImpl.start(Unknown Source) ~[?:1.7.0_55]
    ... 12 more
[18:15:59 INFO]: Deleting C:\Users\Sarina\AppData\Roaming\.minecraft\versions\1.7.4-mcpatcher\1.7.4-mcpatcher-natives-35438263712980
8
  • 2
    We are human as well, we don't look at error reports and just see the problem. Please edit your post and give more information.
    – Caleb
    Commented May 27, 2014 at 8:27
  • 5
    @Caleb - Seems like Minecraft can't find Java. Also: Error reports are supposed to be human-readable, otherwise who would read them?
    – Robotnik
    Commented May 27, 2014 at 8:30
  • 2
    @Caleb - What "more information" do you wish him to provide? An error report is probably the most detailed way to explain an error, despite being hard to read. The fact that your so-called "humans" cannot read it is the reason why a question like this is being posted, and it is our job to answer it.
    – David Toh
    Commented May 27, 2014 at 8:32
  • 6
    @Robotnik, No it can find Java (otherwise you wouldn't have got as far as a Java stacktrace), but it can't find some file or other. When in doubt, delete .minecraft/bin and start the launcher again...
    – fredley
    Commented May 27, 2014 at 8:32
  • @fredley - Yep, that's what I meant :P. It can't find javaw.exe in the minecraft folder. Probably hasn't been added properly to the PATH variable
    – Robotnik
    Commented May 27, 2014 at 8:34

3 Answers 3

10

It seems as though Java is not included in your PATH variables.

What is PATH?

PATH is a list of directories (or paths) in which your OS is supposed to look for executable files (like *.exe) when running things via the command line, if it is not in the current working directory.

In this case, the minecraft launcher needs to execute javaw.exe from the minecraft directory, rather than the java installation folder, something like:

C:\Users\[user]\AppData\roaming\.minecraft> javaw.exe [more stuff that makes javaw run minecraft]

The java installation folder needs to be in PATH for this to work. Normally that is the case automatically, but something might have gone wrong somewhere.

Adding Java to PATH manually

There's an explanation as to how to do it manually on the java website for the most common operating systems:

It seems you are using Windows 7 or 8, so I will copy the corresponding segments here (You will need Administrator rights for this):

Windows 7

  • Select Computer from the Start menu
  • Choose System Properties from the context menu
  • Click Advanced system settings > Advanced tab
  • Click on Environment Variables, under System Variables, find PATH, and click on it.
  • In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  • Reopen Command prompt window, and run your java code.

Windows 8

  • Drag the Mouse pointer to the Right bottom corner of the screen
  • Click on the Search icon and type: Control Panel
  • Click on -> Control Panel -> System -> Advanced
  • Click on Environment Variables, under System Variables, find PATH, and click on it.
  • In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  • Close the window.
  • Reopen Command prompt window, and run your java code.

Editing PATH in this case means to add C:\Program Files\Java\jre7\bin to the list of values, separated from the other entries by a ;. Here's a picture showing it in Windows 7 (click to enlarge), but 8 should be mostly identical in this case.

Editing PATH

2
  • 1
    This answer did not resolve my problem. My resolution is posted here: gaming.stackexchange.com/a/179729/49387
    – mawcsco
    Commented Aug 9, 2014 at 19:58
  • by default the launcher does not use the PATH variable, at least not if started by double clicking the JAR file. In this case the path comes from the file association/type (registry) and apparently the launcher use that as default if not changed in (each) profile. See @mawcsco's answer.
    – user63766
    Commented Jan 21, 2015 at 16:40
3

I stumbled onto this question trying to resolve it myself. I only play minecraft every few months or so and things change rapidly these days. I found the real answer on my own and posted it here.

The Problem

The problem is that the "answers" here don't actually answer the question. First, I am a Java developer and an Android developer. I know, without a doubt, that my Java is properly configured and that there is nothing wrong with my path. The Minecraft Launcher was even able to successfully identify the Java on my system:

[13:34:34 INFO]: Minecraft Launcher 1.5.1 (through bootstrap 5) started on windows...
[13:34:34 INFO]: Current time is Aug 9, 2014 1:34:34 PM
[13:34:34 INFO]: System.getProperty('os.name') == 'Windows 7'
[13:34:34 INFO]: System.getProperty('os.version') == '6.1'
[13:34:34 INFO]: System.getProperty('os.arch') == 'amd64'
[13:34:34 INFO]: System.getProperty('java.version') == '1.8.0_05'
[13:34:34 INFO]: System.getProperty('java.vendor') == 'Oracle Corporation'
[13:34:34 INFO]: System.getProperty('sun.arch.data.model') == '64'
[13:34:34 INFO]: JFX is already initialized
[13:34:34 INFO]: Refreshing local version list...
[13:34:34 INFO]: Refreshing remote version list...
[13:34:36 INFO]: Refresh complete.
[13:34:37 INFO]: Loaded 4 profile(s); selected 'mawcs'
[13:34:37 INFO]: Refreshing auth...
[13:34:37 INFO]: Logging in with access token

And yet, I still get this error when I try to hit the "Play" button:

[13:42:04 ERROR]: Couldn't launch game
java.io.IOException: Cannot run program "D:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:\Users\<user>\AppData\Roaming\.minecraft"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source) ~[?:1.8.0_05]
    at com.mojang.launcher.game.process.direct.DirectGameProcessFactory.startGame(DirectGameProcessFactory.java:14) ~[launcher.jar:?]
    at net.minecraft.launcher.game.MinecraftGameRunner.launchGame(MinecraftGameRunner.java:208) [launcher.jar:?]
    at com.mojang.launcher.game.runner.AbstractGameRunner.onDownloadJobFinished(AbstractGameRunner.java:185) [launcher.jar:?]
    at com.mojang.launcher.updater.download.DownloadJob.popAndDownload(DownloadJob.java:122) [launcher.jar:?]
    at com.mojang.launcher.updater.download.DownloadJob.access$000(DownloadJob.java:12) [launcher.jar:?]
    at com.mojang.launcher.updater.download.DownloadJob$1.run(DownloadJob.java:86) [launcher.jar:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_05]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_05]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_05]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_05]
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method) ~[?:1.8.0_05]
    at java.lang.ProcessImpl.<init>(Unknown Source) ~[?:1.8.0_05]
    at java.lang.ProcessImpl.start(Unknown Source) ~[?:1.8.0_05]
    ... 12 more

The story in screen shots:

Minecraft can see Java on my Path

I still can't launch the game

The Solution

I knew something other than the launcher was looking for Java elsewhere. It turns out, my "profile" was pointing to a specific Java version because I'd overridden the memory settings in a previous play session. To fix this problem, simply edit your profile or create a new one. If you choose edit, at the bottom of the screen is a selection for the Java executable (see screen shots). The simplest solution is to create a new profile.

Profile selection; editing and creating can be done here.

If you edit your profile, this is where the bad path comes from. You can fix it here.

2
Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe"
The system cannot find the file specified

So the system cannot find C:\Program Files\Java\jre7\bin\javaw.exe.

You said a new version of java was installed. Since now we have Java 8, the path may have been changed to C:\Program Files\Java\jre8\bin\javaw.exe.

Check your C:\Program Files\Java\ folder. If there is a folder called jre8, the problem may be some outdated reference to the old jre7 folder.

Open Control Panel » System » (Windows 7 and above: Advanced System Settings) » Advanced » Environment Variables, look at the variables (especially PATH and JAVA_HOME), and edit the jre7 to jre8.

You can also try a quick-and-dirty fix: create a directory link (mklink /d jre7 jre8 in that folder with administrator privileges).

Not the answer you're looking for? Browse other questions tagged or ask your own question.