0

So I have been looking around and nothing worked so I thought I would come here, I am wondering how would I create a Batch file to set library path (Slick and LWJGL + natives) compile and finally run the code for my game

1 Answers1

4

If your app must run on Windows, do the following:

1) create .bat file with the following content:

@java -Dfile.encoding=UTF8 -Xms512m -Xmx1024m -cp "%~dp0\lib\*" mypackage.MyClass %*

2) copy all jars (dependencies and main jar) to "lib" subfolder.

3) run .bat file.

Trivia:

-Dfile.encoding=UTF8 guarantees the same encoding for file read/write operations and for string/bytearray conversions, independently on the OS settings.

-Xms512m - defines minimum memory allocated for java application.

-Xmx1024m - defines maximum memory allocated for java application (it should not exceed physical memory of the target machine, otherwise the program would not start).

mypackage.MyClass should be substituted with a qualified name of the class containing main function.

akhikhl
  • 2,552
  • 18
  • 23