i decided to code a server launch which checks what version java u have and what bit windows you have (hope some one hasnt done this yet) How to do this for first time craftbukkit users 1) download craftbukit (you have) and put into a new folder 2)open notepad 3)paste the code into notepad 4)save as run.bat in the same folder 5)double click to run and follow the steps What to put into the bat file(new one) version 2.0 Code: :start @echo off color a echo. echo Welcome to Bukkit launcher made by jacklin213 echo +-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+ echo What version of Java are you using? echo type help for help set /p input="jre: " if "%input%"=="6" goto java 6 if "%input%"=="7" goto java 7 if "%input%"=="help" goto help if "%input%"=="exit" exit if "%input%"=="stop" exit if "%input%"=="reload" goto start if "%input%"=="jre -v" goto jrechecker if not "%input%"=="input" color 02 echo Not a valid version! pause goto start cls ---------------------help---------------------------- :help @echo off cls color a echo. echo Welcome to the help section echo echo jre -v = checks what version of java your using echo 6 = jre version 6 echo 7 = jre version 7 echo help = here echo exit = quit echo stop = quit pause cls goto start ---------------------java version checker------------ :jrechecker @echo off cls color f echo. echo Welcome to the java version checker echo if it says java version "1.6" type in 6 when u go back to the home screen echo if it says java version "1.7" type in 7 when u go back to the home screen echo if it says no java installed u need to install java echo. java -version pause cls goto start ---------------------java 6------------------------- :java 6 @echo off color a echo. echo Is your computer 32 bit or 64 bit? set /p bit="bit: " if "%bit%"=="32" goto 32jre6 if "%bit%"=="64" goto 64jre6 if not "%bit%"=="bit" color 02 echo Not a valid bit pause cls goto java 6 -------------------java 6. 32bit computer------------ :32jre6 @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit -------------------java 6. 64bit computer------------ :64jre6 @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit ---------------------java 7-------------------------- :java 7 @echo off color a echo. echo Is your computer 32 bit or 64 bit? set /p bit="bit: " if "%bit%"=="32" goto 32jre7 if "%bit%"=="64" goto 64jre7bitcheck if not "%bit%"=="bit" color 02 echo Not a valid bit pause cls goto java 7 :32jre7 @echo off color a echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(86)%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit --------------------java 7 bit selection-------------- :64jre7bitcheck @ECHO OFF color a echo. echo What bit java are you running? set /p jrebit="jrebit: " if "%jrebit%"=="32" goto 32jre7.64comp if "%jrebit%"=="64" goto 64jre7.64comp if not "%jrebit%"=="jrebit" color 02 echo Not a valid bit pause cls goto 64jre7bitcheck -------------------java 7 32 bit. 64bit computer------------- :32jre7.64comp @echo off color a echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit ------------------java 7 64bit. 64bit computer---------------- :64jre7.64comp @echo off color a echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit Change log added noob friendly guide version 2.0 fixed error for 64 bit computer version 2.0 added 64bit java selection for 64 bit computer version 2.0 added topics above code so u wouldnt get confused version 1.0 release What to put into the bat file(old one) version 1.0 Code: :start @echo off color a echo. echo Welcome to Bukkit launcher made by jacklin213 echo +-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+ echo What version of Java are you using? echo type help for help set /p input="jre: " if "%input%"=="6" goto java 6 if "%input%"=="7" goto java 7 if "%input%"=="help" goto help if "%input%"=="exit" exit if "%input%"=="stop" exit if "%input%"=="reload" goto start if "%input%"=="jre -v" goto jrechecker if not "%input%"=="input" color 02 echo Not a valid version! pause goto start cls :help @echo off cls color a echo. echo Welcome to the help section echo echo jre -v = checks what version of java your using echo 6 = jre version 6 echo 7 = jre version 7 echo help = here echo exit = quit echo stop = quit pause cls goto start :jrechecker @echo off cls color f echo. echo Welcome to the java version checker echo if it says java version "1.6" type in 6 when u go back to the home screen echo if it says java version "1.7" type in 7 when u go back to the home screen echo if it says no java installed u need to install java echo. java -version pause cls goto start :java 6 @echo off color a echo. echo Is your computer 32 bit or 64 bit? set /p bit="bit: " if "%bit%"=="32" goto 32jre6 if "%bit%"=="64" goto 64jre6 if not "%bit%"=="bit" color 02 echo Not a valid bit pause cls goto java 6 :32jre6 @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit :64jre6 @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit :java 7 @echo off color a echo. echo Is your computer 32 bit or 64 bit? set /p bit="bit: " if "%bit%"=="32" goto 32jre7 if "%bit%"=="64" goto 64jre7 if not "%bit%"=="bit" color 02 echo Not a valid bit pause cls goto java 7 :32jre7 @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit :64jre7 @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit Where to put it? In the same file as your craftbukkit.jar NOTE THIS WORKS OVER RUN.bat
Thx for the answer (http://forums.bukkit.org/threads/error-when-seting-up-a-server-need-help.87281/#post-1222616) but when i type in that I have java 7 and 64 bit it serch for C:\ProgramFiles (x86)(isn't x86 to 32 bit?)\Java\jre6 (it should be jre7)\bin\java.exe so it dont work, but if u change the code a bit it might work! thx 4 the help!
perhaps it work if u tell me the questions and do a code 4 it, i know i use java 7 but dont know if its 32 or64 bit so u can do 2 codes one with programfiles and one with programfiles(x86) Do u need to know where my craftbukkit is located??
@vam-knosen on a 64 bit computer java is usally downloaded into programfiles(x86) because its a 32bit program
Ok java is mabe in (x86) you do know this stuff better than me (but your code still dont work 4 me , maybe cause :java 7 @echo off color a echo. echo Is your computer 32 bit or 64 bit? set /p bit="bit: " if "%bit%"=="32" goto 32jre7 if "%bit%"=="64" goto 64jre7 if not "%bit%"=="bit" color 02 echo Not a valid bit pause cls goto java 7 :32jre6 ______________32jre6!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit :64jre6 ________________64jre6!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @ECHO OFF echo starting server SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE exit it should be 32/64jre7??? But cant you ask me the questions instead of the cmd so you can do a code just 4 my computer, i dunno what you need 2 know 4 that but i can tell you a bit, i have 64bit windows and java7, do you need 2 know where my craftbukkit-1.2.5-R4.0 is located? or where my java is located? just say and i tell you!
oic i did i little research and just found out there is such thing as a 64 bit java so let me go change the coding a bit
Instead of these insane launch scripts, why not a tutorial, or script to properly configure the users PATH variable, thus resulting in a launch script that looks like this: Code: @echo off java -Xincgc -Xmx1G -jar craftbukkit.jar pause Not trying to hate on your tool, its great to see. I've just seen these tools show up over the last year and a half, but never a tool to configure the PATH variable so these tools aren't needed.
@TnT sry im kinda geting lost here does this code work? Code: @echo off java -Xincgc -Xmx1G -jar craftbukkit.jar pause doesnt it need to know where java is sry i have a small brain
@jacklin213 Provided your path variable is correct, it works like a charm. If this works (see below), you can run the server with just the "java" command. The rest is only really needed if you want to call a Java version that isn't shown by that command, or if that command fails to find Java. (Note, I, of course, do not have java installed in my c:\users directory). Installing x64 Java does this all for you, but I've seen the x86 Java have problems. Code: C:\Users\TnT>java -version java version "1.6.0_31" Java(TM) SE Runtime Environment (build 1.6.0_31-b05) Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode) Notice how its the same as below? Code: C:\Users\TnT>"C:\Program Files\Java\jre6\bin\java" -version java version "1.6.0_31" Java(TM) SE Runtime Environment (build 1.6.0_31-b05) Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)
oh but I'm interested about the directory thingy I tried to make it so u could type in the folder of where your server was located but it didn't work. maybe I just didn't know the code
SOMEONE PLZ HELP! when i run the run.bat (with this code: @echo off java -Xincgc -Xmx1G -jar craftbukkit.jar pause) it says Unable to access jarfile craftbukkit.jar! my craftbukkit is named craftbukkit-1.2.5-R4.0 I have java 1.7.0_05 and a 64 bit computer
Now with this code: @ECHO OFF java -Xmx1024M -Xms1024M -jar "%~dp0craftbukkit.jar" PAUSE (and the new recomended build, 1.2.5-R5.0,) it says java.lang.ExceptionInInitializerError again (I have tested to reinstall java it dont work either)
try this code if your java is installed in ProgramFiles(86) Code: @echo off SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE use this code if it is installed in programfiles Code: @echo off SET BINDIR=%~dp0 CD /D "%BINDIR%" "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit.jar PAUSE
Hi jacklin213 dont go offline, i need your help, in the comment over my the 2 codes is the same, and i think you forgot the x in programfiles(!!!x!!!!86), but i changed that and none of em worked! CHECK NEXT SIDE 4 MY NEW COMMENT