# [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.

## 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 on other sites
System.out.println(System.getProperty("java.library.path")) should show you if you're getting the right directory in there.

Cas :)

##### 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 on other sites

<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 on other sites
Thanks Lucidquiet!

Using the dot-slash didn't work, but the base-dir property worked fine.

Thanks again!

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632985
• Total Posts
3009723
• ### Who's Online (See full list)

There are no registered users currently online

×