Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

start server.bat gives error, closes. "'java' is not recognized as..."


  • Please log in to reply
12 replies to this topic

#1

Kirk
    Kirk

    Tree Puncher

  • Members
  • 14 posts

Posted 01 July 2009 - 04:54 PM

"'java' is not recognized as an internal or external command,
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

Register or log in to remove.

#2

LilRobot

Posted 01 July 2009 - 04:58 PM

A tutorial was already made for this.

#3

Kirk
    Kirk

    Tree Puncher

  • Members
  • 14 posts

Posted 01 July 2009 - 04:59 PM

I followed it and on the first step I got this error. None of the faq relate to this as it is a error.
EDIT: I have Java installed.

#4

Flask
    Flask

    Out of the Water

  • Members
  • 3 posts

Posted 01 July 2009 - 08:02 PM

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.

#5

Kirk
    Kirk

    Tree Puncher

  • Members
  • 14 posts

Posted 02 July 2009 - 01:05 AM

I fixed it.

#6

jaymen1990

Posted 02 July 2009 - 02:47 AM

Quote

A tutorial was already made for this.
can someone give me a link please or  help me I'm having the same problem I'm running vista

#7

motile
    motile

    Newly Spawned

  • Members
  • 1 posts

Posted 05 July 2009 - 06:12 PM

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.

http://java.sun.com/...loads/index.jsp

I'm telling you guys this because I would have killed to know this about an hour ago, haha.

#8

victory
    victory

    Out of the Water

  • Members
  • 3 posts

Posted 06 July 2009 - 05:54 PM

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.

Guess what? Vista 64 bit, baby.

#9

Thi3f
    Thi3f

    Carpenter

  • Members
  • 47 posts

Posted 06 July 2009 - 10:35 PM

Make sure you're running x64 Java, in x64 browser, or x86 Java in x86 browser. If you mix them up it might get weird.

#10

rockerest

Posted 09 July 2009 - 04:06 PM

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

#11

Thi3f
    Thi3f

    Carpenter

  • Members
  • 47 posts

Posted 09 July 2009 - 11:36 PM

Quote

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

#12

blahblahblah3

Posted 19 December 2010 - 09:36 PM

rockerest said:

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

#13

Megakaby
    Megakaby

    Tree Puncher

  • Members
  • 14 posts

Posted 29 May 2011 - 03:24 AM

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)

does anyone kno the cause and/or how to fix it?