01-03-2011, 10:58 PM
Доброго времени суток:
Помогите приспособить батник, предназначенный для запуска сервера, на 32bit Java но на 64bit OS.
Необходимо запустить на 32bit OS.
При запуске выдаёт такую ошибку:
Помогите приспособить батник, предназначенный для запуска сервера, на 32bit Java но на 64bit OS.
Необходимо запустить на 32bit OS.
Код:
@echo off
:start
set JAVA6="auto"
set JAR=aj-gameserver.jar
set X86="%ProgramFiles(x86)%"
if %JAVA6% == "auto" (
echo Autodetecting java
if %X86% NEQ "" (
echo Testing x86 folder
for /D %%j in ("%ProgramFiles(x86)%\jre6*" "%ProgramFiles(x86)%\jre1.6.*" "%ProgramFiles(x86)%\jdk1.6.*" "%ProgramFiles(x86)%\Java\jre6*" "%ProgramFiles(x86)%\Java\jre1.6.*" "%ProgramFiles(x86)%\Java\jdk1.6.*") do (
echo Checking %%j folder
if exist "%%j\bin\java.exe" (
echo Found java in %%j folder
set JAVA6="%%j\bin\java.exe"
)
)
) else (
echo Testing default folder
if defined ProgramFiles (
for /D %%j in ("%ProgramFiles%\jre6*" "%ProgramFiles%\jre1.6.*" "%ProgramFiles%\jdk1.6.*" "%ProgramFiles%\Java\jre6*" "%ProgramFiles%\Java\jre1.6.*" "%ProgramFiles%\Java\jdk1.6.*") do (
echo Checking %%j folder
if exist "%%j\bin\java.exe" (
echo Found java in %%j folder
set JAVA6="%%j\bin\java.exe"
)
)
)
)
)
:rerun
if %JAVA6% == "auto" (
echo ERROR: Java not found!
echo Please download and install from java.com
pause
exit
) else (
echo Starting java from %JAVA6%
%JAVA6% -Xms512m -Xmx1536m -ea -Xbootclasspath/p:./libs/jsr166.jar -cp ./libs/*;%JAR% com.aionjava.gameserver.GameServer
if errorlevel 11 (
if not exist %JAR% (
echo ========================================
echo Warning: %JAR% not not found.
echo ========================================
)
echo ERROR: Failed to run %JAR%
echo JAVA6=%JAVA6%
pause
exit
)
if errorlevel 10 (
goto rerun
)
if errorlevel 1 (
if not exist %JAR% (
echo ========================================
echo Warning: %JAR% not found.
echo ========================================
)
echo ERROR: Failed to run %JAR%
echo JAVA6=%JAVA6%
pause
exit
)
)
При запуске выдаёт такую ошибку:
Код:
Autodetecting java
Testing default folder
Checking D:\Program Files\Java\jre6 folder
Found java in D:\Program Files\Java\jre6 folder
Checking D:\Program Files\Java\jdk1.6.0_21 folder
Found java in D:\Program Files\Java\jdk1.6.0_21 folder
Starting java from "D:\Program Files\Java\jdk1.6.0_21\bin\java.exe"
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
========================================
Warning: aj-gameserver.jar not found.
========================================
ERROR: Failed to run aj-gameserver.jar
JAVA6="D:\Program Files\Java\jdk1.6.0_21\bin\java.exe"
Для продолжения нажмите любую клавишу . . .
Консоль GameServer не советует:"Вы настраивайте сервер уже 1 час. Советуем вам немного отдохнуть".