LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Finalspace on May 31, 2012, 21:03:03

Title: Problem with deploying my game
Post by: Finalspace on May 31, 2012, 21:03:03
Hi there,

i cannot run my created jar file which contains my LWJGL based game.
It simply does not start and throws a java.lang.ClassNotFoundException: org.lwjgl.LWJGLException.

Here is my jar´s structure:


[platformer.jar]
+ content (Contains resources and stuff)
+ engine (Contains compiled java classes)
+ game (Contains compiled java classes)
+ lwjgl-2.8.3
  + native
    + windows (contains all the required windows dll´s for lwjgl)
+ META-INF
  MANIFEST.MF
lwjgl.jar


Here is the automatic created MANIFEST.MF:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_32-b05 (Sun Microsystems Inc.)
Main-Class: game.PlatformerGame
Class-Path: lwjgl.jar


and here is my ant script for building my game and creating the jar:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Platformer" default="compile" basedir="bin">
<description>Platformer Ant Targets</description>

<target name="init">
<property name="build.dir" value="../bin" />
<property name="source.dir" value="../src" />
<property name="lwjgl.dir" value="../lwjgl-2.8.3" />
</target>

<target name="compile" depends="init">
<javac debug="true" srcdir="${source.dir}" destdir="${build.dir}" target="1.6" source="1.6" includeantruntime="false">
<classpath>
<pathelement path="${lwjgl.dir}/jar/lwjgl.jar" />
</classpath>
</javac>
<jar jarfile="../dist/platformer.jar" basedir="${build.dir}" >
<zipfileset dir="${lwjgl.dir}/jar" includes="lwjgl.jar" />
<zipfileset dir="${lwjgl.dir}/native" prefix="lwjgl-2.8.3/native" />
<zipfileset dir="../content" prefix="content" />
<manifest>
<attribute name="Class-Path" value="lwjgl.jar" />
<attribute name="Main-Class" value="game.PlatformerGame" />
</manifest>
</jar>
</target>
</project>


What i am doing wrong? The classpath is properly set in the manifest file, the main class is there too.
Also the required lwjgl.jar is in the jar and the native files too...

Please help me,
Thanks,
Final
Title: Re: Problem with deploying my game
Post by: dangerdoc on August 05, 2012, 21:04:12
For me the files have to be outside of the jar, like lwjgl.jar and the natives.