Solved Batch file not working?

Discussion in 'Bukkit Help' started by Rizzaclark5, Apr 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Rizzaclark5

    My batch file is not working
    Everything else is find but my batch file?

    My computer specs
    Windows 7
    Intel core i5-3210M, 2.5GHz
    HDD 750GB
    4GB RAM
    GeForce GT 610M

    This is my batch file
    java -Xmx1024M -jar craftbukkit.jar -o true
    PAUSE
     
  2. Rizzaclark5 Remove the .jar from craftbukkit and leave it at craftbukkit.
     
  3. Offline

    kungfuko

    What does it say in console?
     
  4. Offline

    Rizzaclark5

    kungfuko
    [23:11:23 INFO]: Starting minecraft server version 1.7.9
    [23:11:23 WARN]: To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
    [23:11:23 INFO]: Loading properties
    [23:11:23 ERROR]: Exception handling console input
    java.io.IOException: The handle is invalid
    at java.io.FileInputStream.readBytes(Native Method) ~[?:1.7.0_55]
    at java.io.FileInputStream.read(Unknown Source) ~[?:1.7.0_55]
    at java.io.BufferedInputStream.read1(Unknown Source) ~[?:1.7.0_55]
    at java.io.BufferedInputStream.read(Unknown Source) ~[?:1.7.0_55]
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) ~[?:1.7.0_55]
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source) ~[?:1.7.0_55]
    at sun.nio.cs.StreamDecoder.read(Unknown Source) ~[?:1.7.0_55]
    at java.io.InputStreamReader.read(Unknown Source) ~[?:1.7.0_55]
    at java.io.BufferedReader.fill(Unknown Source) ~[?:1.7.0_55]
    at java.io.BufferedReader.readLine(Unknown Source) ~[?:1.7.0_55]
    at java.io.BufferedReader.readLine(Unknown Source) ~[?:1.7.0_55]
    at lu.run(SourceFile:81) [minecraft_server.jar:?]
    [23:11:23 INFO]: Default game type: SURVIVAL
    [23:11:23 INFO]: Generating keypair
    [23:11:25 INFO]: Starting Minecraft server on 192.168.0.3:25565
    [23:11:26 INFO]: Preparing level "world"
    [23:11:26 INFO]: Preparing start region for level 0
    [23:11:27 INFO]: Preparing spawn area: 24%
    [23:11:28 INFO]: Preparing spawn area: 97%
    [23:11:28 INFO]: Done (2.495s)! For help, type "help" or "?"
     
  5. Offline

    LHammonds

    #1 - From your log file, you are trying to run a bleeding edge version of CraftBukkit. Start with something more stable such as the Beta build 3020 of CraftBukkit 1.7.2-R0.3. Once you get your server up-n-running solid, then experiment with bleeding edge builds. Basically, always have something solid to fall back onto when testing new stuff.

    #2 - Here is the batch file I use when running servers on my Windows PC. 2nd line sets the amount of RAM to use in Megabytes and 3rd line is the drive/directory where the servers is located (NOTE: Do NOT run CraftBukkit under the C:\ProgramFiles folder)

    Code:
    @ECHO OFF
    SET RAM2USE=2048
    CD /D C:\CraftBukkit
    
    REM ** Look for a version of Java 7 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre7\bin\java.exe" GOTO JAVA7DEFAULT
    
    REM ** Look for 32-bit version of Java 7 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" GOTO JAVA732BIT
    
    REM ** Look for a version of Java 6 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre6\bin\java.exe" GOTO JAVA6DEFAULT
    
    REM ** Look for 32-bit version of Java 6 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" GOTO JAVA632BIT
    
    :JAVA7DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 7 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 7 **
    "%ProgramFiles%\Java\jre7\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
    
    :JAVA732BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 7 **
    "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
    
    :JAVA6DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 6 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 6 **
    "%ProgramFiles%\Java\jre6\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
    
    :JAVA632BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 6 **
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
    
    :DONE
    REM ** This will pause the screen so you can see any error messages after stopping the CraftBukkit server. **
    PAUSE
    
     
    MaliciousMan likes this.
  6. Offline

    Rizzaclark5

    So does that mean i have to make a 1.7.2 server or will it work for 1.7.9
    and i dont know what your saying with the codes i have a 64bit system
    LHammonds
     
  7. Offline

    MikaXD

  8. Offline

    MaliciousMan

    His script works on 32 & 64 bit computers. It automatically picks the right one. At the very top, on the 2nd line, change RAM2USE to the amount of megabytes you want allocated. Then the 3rd line to the correct directory of bukkit.

    Literally reiterated exactly what LHammonds said... Rizzaclark5 don't be so lazy and read the whole post.
     
  9. Offline

    LHammonds

    No, you can do whatever you want. I'm just suggesting a path to give a newbie the least amount of headache.

    The stuff in the CODE section is for you to copy and paste into a batch file. Example: startcb.bat

    You then double-click "startcb.bat" which will find the best version of java on your system and use it to start your CraftBukkit server.

    FYI - The JDK (Java Development Kit) is NOT required to run a server or your client. You only need the JRE (Java Runtime) and it is suggested you get the latest version of Java which is 1.7.0 Update 55 at the time of this post. If you have a 64-bit OS, it is recommended that you install both the 32-bit and 64-bit versions of Java. Why? Because you can use the 64-bit version of Java for Minecraft but web browsers only use the 32-bit version of Java so you'd need both and they happily reside together on the same system.

    LHammonds
     
  10. Offline

    Rizzaclark5

    Thank you MikaXD for solving this :D
     
Thread Status:
Not open for further replies.

Share This Page