Jump to content
  • Advertisement
Sign in to follow this  
Son of Cain

[java] What's wrong with this ant target?

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm trying to run a LWJGL app with a custom ant target that I wrote. I specify the "java.library.path" property to the /native directory, which is the directory that contains all the LWJGL dlls. Here is the code of the target:

    <target name="run-engine" depends="init, build" description="Runs the Engine">
        <java classname="net.java.dev.bta.engine.GameEngine" fork="true" dir="${build}" failonerror="true">
            <jvmarg value="-Xms64m"/>
            <jvmarg value="-Djava.library.path=${native}"/>
            <jvmarg value="-Dsun.java2d.opengl=True"/>
            <classpath>
                <pathelement location="${build}"/>
                <fileset dir="${lib}" includes="**/*.jar"/>
            </classpath>
        </java>
    </target>
Still, I get the "java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path". I don't see where I'm doing the mistake. The /native folder contains all the .dll files necessary for LWJGL to run. So, can you guys hint what's wrong? Son Of Cain

Share this post


Link to post
Share on other sites
Advertisement
System.out.println(System.getProperty("java.library.path")) should show you if you're getting the right directory in there.

Cas :)

Share this post


Link to post
Share on other sites
Yeah... how dumb of me, should have tried that earlier!

It prints out the value of the ant property, which is only the name of the folder. In order to make it work, I have to specify the full path for the dir in the OS - that being, in windows, "C:/.../native".

I would like it to understand the path just like the "src" or "build" properties, which I declared exactly in the same way, without having to specify the full path in the OS for their values.

So, how can I do that?

Son Of Cain

Share this post


Link to post
Share on other sites
The line we are talking about is the one that reads:

<jvmarg value="-Djava.library.path=${native}"/>

Does it work if you change it from just a straight ${native} to ./${native} ?
Or perhaps ${basedir}/${native}. It might use the ${build} directory as the CWD, so perhpas the second is the option.

L-

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!