Java isn't added to the command line search. When the batch file calls for java, windows doesn't know where to go to find it. I had to add it to the command line search path myself then it worked just fine.
Not sure how to do it in XP, though. I'm running Vista, and I just poked around at random until I found what I was looking for.
Okay, this is how I fixed the problem (I'm running x64 Vista)
I downloaded the "Java SE Runtime Environment". Don't ask me how I got there, or what it fixed it, I'm not sure, haha. But this is what allowed the .bat to finally work. You can download it from this page.
I had the 'java' is not recognized Error. Then I installed SE runtime and now it says...
Exception in thread 'main' java.lang.noclassdeffoundError: com/mojang/minecraft/server/MinecraftServer
Ect....
Also,
Could not find the main class com.mojang.minecraft.server.MinecraftServer program will exit.
I have no idea what the tutorial says, but the first problem ("Java not recognized....etc etc") is because Java needs to be added to the Windows environment PATH variable.
Go to Control Panel > System > Environment Variables and edit the one named "PATH" to include the location of java.exe (like, C:\Program Files\Java\JRE\java##.#_##\bin\)
Save the variable, and get out of all the windows. That should fix that error.
The error that the people are having more recently ("Exception in 'main'....") has to do with how the Java program is running. You need to navigate to the folder where the server files are located and run the bat file from the command line. Not sure why double clicking doesn't work, but cmd line should do the trick.
I have no idea what the tutorial says, but the first problem ("Java not recognized....etc etc") is because Java needs to be added to the Windows environment PATH variable.
Go to Control Panel > System > Environment Variables and edit the one named "PATH" to include the location of java.exe (like, C:\Program Files\Java\JRE\java##.#_##\bin\)
Save the variable, and get out of all the windows. That should fix that error.
The error that the people are having more recently ("Exception in 'main'....") has to do with how the Java program is running. You need to navigate to the folder where the server files are located and run the bat file from the command line. Not sure why double clicking doesn't work, but cmd line should do the trick.
-rock
QFT. An alternative to adding it as an environment variable is to edit this line in the .bat file
java -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer
And add the full path to java, like such (Be sure to check the path):
"C:\Program Files\Java\jre6\bin\java.exe" -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer
I have no idea what the tutorial says, but the first problem ("Java not recognized....etc etc") is because Java needs to be added to the Windows environment PATH variable.
Go to Control Panel > System > Environment Variables and edit the one named "PATH" to include the location of java.exe (like, C:\Program Files\Java\JRE\java##.#_##\bin\)
Save the variable, and get out of all the windows. That should fix that error.
The error that the people are having more recently ("Exception in 'main'....") has to do with how the Java program is running. You need to navigate to the folder where the server files are located and run the bat file from the command line. Not sure why double clicking doesn't work, but cmd line should do the trick.
-rock
i tried editing path but when i click on it, the edit button is dimmed out and i can't do it windows 7
help me plz... my new server has a problem. my cpu ran out of memory for the server, so today 1 of my friends told me to run it as a batch file. i did, and now ppl are getting "internal server error"s!! help! this is what the server says when this happens:
[WARNING] Failed to handle packet: java.lang.NullPointerException
java.lang.NullPointerException
at dj.a(SourceFile:307)
at ek.a(SourceFile:370)
at lm.e(SourceFile:810)
at do.b(SourceFile:183)
at fa.b(SourceFile:92)
at ec.b(SourceFile:119)
at ec.a(SourceFile:92)
at ir.a(SourceFile:43)
at ji.b(SourceFile:277)
at ec.a(SourceFile:56)
at cs.a(SourceFile:91)
at net.minecraft.server.MinecraftServer.h(SourceFile:378)
at net.minecraft.server.MinecraftServer.run(SourceFile:307)
at bo.run(SourceFile:422)
operable program or batch file.
Press any key to continue . . ."
Thats the error. If Someone could help me it would be awesome.
Windows XP SP3 64 Bit Edition
I don't know what other specs to give. O.o
EDIT: I have Java installed.
Not sure how to do it in XP, though. I'm running Vista, and I just poked around at random until I found what I was looking for.
can someone give me a link please or help me I'm having the same problem I'm running vista
I downloaded the "Java SE Runtime Environment". Don't ask me how I got there, or what it fixed it, I'm not sure, haha. But this is what allowed the .bat to finally work. You can download it from this page.
http://java.sun.com/javase/downloads/index.jsp
I'm telling you guys this because I would have killed to know this about an hour ago, haha.
Exception in thread 'main' java.lang.noclassdeffoundError: com/mojang/minecraft/server/MinecraftServer
Ect....
Also,
Could not find the main class com.mojang.minecraft.server.MinecraftServer program will exit.
Guess what? Vista 64 bit, baby.
Go to Control Panel > System > Environment Variables and edit the one named "PATH" to include the location of java.exe (like, C:\Program Files\Java\JRE\java##.#_##\bin\)
Save the variable, and get out of all the windows. That should fix that error.
The error that the people are having more recently ("Exception in 'main'....") has to do with how the Java program is running. You need to navigate to the folder where the server files are located and run the bat file from the command line. Not sure why double clicking doesn't work, but cmd line should do the trick.
-rock
QFT. An alternative to adding it as an environment variable is to edit this line in the .bat file
java -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer
And add the full path to java, like such (Be sure to check the path):
"C:\Program Files\Java\jre6\bin\java.exe" -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer
i tried editing path but when i click on it, the edit button is dimmed out and i can't do it windows 7
[WARNING] Failed to handle packet: java.lang.NullPointerException
java.lang.NullPointerException
at dj.a(SourceFile:307)
at ek.a(SourceFile:370)
at lm.e(SourceFile:810)
at do.b(SourceFile:183)
at fa.b(SourceFile:92)
at ec.b(SourceFile:119)
at ec.a(SourceFile:92)
at ir.a(SourceFile:43)
at ji.b(SourceFile:277)
at ec.a(SourceFile:56)
at cs.a(SourceFile:91)
at net.minecraft.server.MinecraftServer.h(SourceFile:378)
at net.minecraft.server.MinecraftServer.run(SourceFile:307)
at bo.run(SourceFile:422)
does anyone kno the cause and/or how to fix it?