1

Setting java.library.path at runtime doesn't do anything:

public class Test{
public static void main(String []args){
    System.out.println(System.getProperty("java.library.path"));
}
}

I run Test (having build it previously) like this:

user:~$ sudo java -d64 Test -Djava.library.path=./Music/

The output is:

/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

What am I doing wrong? Did this happen to anyone else?

Also, I tried to set it in the command line, with the same result:

user:~$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./Music/
user:~$ echo $LD_LIBRARY_PATH
> ./Music
user:~$ java -XshowSettings:properties
Property settings:
....
java.library.path = ./Music
    /usr/java/packages/lib/amd64
    /usr/lib64
    /lib64
    /lib
    /usr/lib
1
  • reserved property? did you try with another property? Commented Oct 24, 2013 at 12:14

1 Answer 1

2
sudo java -Djava.library.path=./Music/ -d64 Test 

Et voila :-) The "-D" must go before your programme's name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.