How to install

Revision as of 00:26, 2 February 2013 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to install

There isn't much to install. The 3D engine itself is one jar only (jpct.jar). It can be found in the distribution's lib-directory. Just include that jar into your classpath and you are ready to compile and/or run jPCT applications. When using the hardware renderers, you have to include some LJWGL jars in addition. jPCT based applications require the lwjgl.jar and the lwjgl_util.jar. Both are included in the distribution and can be found in the lib-directory as well. In addition, you have to specify the location of the native components that LWJGL uses to access the hardware. Under Windows, these are so called DLLs, under Linux SOs etc. To include them, the easiest way is to specify the java library path. On the command line, this is done by adding a -Djava.library.path-parameter to your command. For example

java -classpath jpct.jar;lwjgl.jar;lwjgl_util.jar;myJar.jar -Djava.library.path=path_to_the_native_stuff MyTest

if the native components are located in the directory "path_to_the_native_stuff". Please note that you only have to specify the directory, not the files themselves (this is different compared to the classpath-paramater).

In Eclipse, you can add the -Djava...line in the "VM Arguments" textbox of your "Arguments" tab in the Run Configuration of your application. Another option is to add the three jar files you need (jpct.jar; lwjgl.jar; lwjgl_util.jar;) to the Build Path. To access the Build Path right click on the package folder in the package explorer and select "properties". In the package properties find the tab that says "Java Build Path", and navigate to the "Libraries" window. To add the .jar files simply click on the "Add External JARs" button, and navigate to the folder location of the jPCT .jar files.


If you want to use javadoc and native libraries in your IDE, configure path to it like this.

Build path.png

After configuring this, you should be able to compile and start any jPCT based application.

If the application can start but stops running immediately afterwards, check the application’s log files. If the error is java.lang.NoClassFoundError, the solution is simple. A folder in the jpct application package titled “lib” needs to be renamed “libs”. After renaming this folder the application should work.

If you going to use jPCT's JOGL-support instead of LWJGL, don't add the LWJGL jars but the ones from JOGL instead and add the glfacade.jar in addition (it comes with the distribution of jPCT in the jogl-subdir of the lib-dir).