Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Compiling multiple jars into a single one (Eclipse)

    Hi so my game runs off libs from lwjgl and slick.
    when i export my project as a runnable jar, i package everything together; then ofcourse i run it in cmd with java -jar JARNAME. I get errors. I saved the ANT script and see this in the manifest:

    Java Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <project default="create_run_jar" name="Create Runnable Jar for Project Game with Jar-in-Jar Loader">
        <!--this file was created by Eclipse Runnable JAR Export Wizard-->
        <!--ANT 1.7 is required                                        -->
        <target name="create_run_jar">
            <jar destfile="C:/Users/Connor/Desktop/Defend.jar">
                <manifest>
                    <attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
                    <attribute name="Rsrc-Main-Class" value="javagame.Game"/>
                    <attribute name="Class-Path" value="."/>
                    <attribute name="Rsrc-Class-Path" value="./ lwjgl.jar slick.jar"/>
                </manifest>
                <zipfileset src="jar-in-jar-loader.zip"/>
                <fileset dir="C:/Users/Connor/workspace/Game/bin"/>
                <zipfileset dir="C:\Users\Connor\workspace\Game\lib\jars" includes="lwjgl.jar"/>
                <zipfileset dir="C:\Users\Connor\workspace\Game\lib\jars" includes="slick.jar"/>
            </jar>
        </target>
    </project>
    i mean everything looks like it should work but its not?
    heres an image of the cmd; note thats all it says, any farther down it just says "...and 5 more".
    Compiling multiple jars into a single one (Eclipse)-error.png

    any help would be appreciated, thanks.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Compiling multiple jars into a single one (Eclipse)

    There's an lwjgl dll somewhere that it's missing.
    I've also never understood the desire to reduce things to a single jar file...
    Please do not ask for code as refusal often offends.

  3. #3
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Re: Compiling multiple jars into a single one (Eclipse)

    Quote Originally Posted by Tolls View Post
    There's an lwjgl dll somewhere that it's missing.
    I've also never understood the desire to reduce things to a single jar file...
    Thats strange .. it runs fine in eclipse and im pretty sure its extracting the same things it uses to run it in there.
    Either way, I cant get it to run; in a single jar or with all 3 of them separate. Is there a special way to run a jar that needs other jars to run it?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Compiling multiple jars into a single one (Eclipse)

    You need the dll.
    Without it it doesn't work.
    So the DLL must have installed somewhere.
    Where did you download it from?
    Please do not ask for code as refusal often offends.

  5. #5
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Re: Compiling multiple jars into a single one (Eclipse)


  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Compiling multiple jars into a single one (Eclipse)

    Here's the installation bit:
    Downloading and Setting Up LWJGL - LWJGL
    Specifically this part:
    "
    I keep getting an java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

    This is because the native part is not setup correctly. Add a -Djava.library.path=path/to/dir to the commandline or as an VM option in your IDE so that lwjgl is able to find the folder containing the native files.
    "
    Please do not ask for code as refusal often offends.

  7. #7
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Re: Compiling multiple jars into a single one (Eclipse)

    This is because the native part is not setup correctly. Add a -Djava.library.path=path/to/dir to the commandline or as an VM option in your IDE so that lwjgl is able to find the folder containing the native files.
    how exactly would i do this? ive watched the video and have done everything that is done in the video awhile ago.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Compiling multiple jars into a single one (Eclipse)

    Distributing Your LWJGL Application - LWJGL

    I really recommend going to the source rather than relying on YouTube tutorials.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Multiple compiling from DOS
    By zenitis in forum New To Java
    Replies: 4
    Last Post: 12-27-2011, 08:26 PM
  2. Multiple Java in a single BOX
    By luke_devon in forum New To Java
    Replies: 2
    Last Post: 07-05-2010, 01:59 PM
  3. Create jar from multiple jars
    By rummy in forum New To Java
    Replies: 2
    Last Post: 01-06-2010, 03:03 PM
  4. Replies: 0
    Last Post: 08-19-2008, 04:44 PM
  5. Compiling a single class
    By ROSOBORONEXPORTCORP in forum New To Java
    Replies: 2
    Last Post: 01-28-2008, 12:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •