3

I am trying to use DLL's from a specific place from the disk (because I am using JNotify library).

Using Netbeans 7.4, the following happened:

My temporary program only does:

System.out.println(System.getProperty("java.library.path"));

As VM options in Netbeans I have set: -Djava.library.path=D:/JNotify-dll/. Program outputs: D:/Jnotify-dll/.

When I run it as normal java <jarfile>: It gives main class not set, while I did set it in Netbeans options.

When I run it as java -jar <jarfile>: It gives me my %PATH% variable.

When I run it as java -jar <jarfile> -Djava.library.path=D:/JNotify-dll/ it still gives me my %PATH% variable.

Does anyone have any clue what is going on? I am getting real tired of it.

The MANIFEST.MF generated by Netbeans:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.1
Created-By: 1.7.0_25-b17 (Oracle Corporation)
Class-Path: lib/ORM.jar lib/mysql-connector-java-5.1.23-bin.jar lib/co
 mmons-dbcp-1.4-javadoc.jar lib/commons-dbcp-1.4.jar lib/commons-pool-
 1.6-javadoc.jar lib/commons-pool-1.6.jar lib/jnotify-0.94.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: bf4.bf4logreader.BF4LogReader

EDIT: java -jar -Djava.library.path=D:/JNotify-dll/ <jarfile>, but I'd still appreciate an answer.

1 Answer 1

15

You need to change the order of your command line arguments:

java -Djava.library.path=D:/JNotify-dll/ -jar <jarfile> 

See also:

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.