Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the java.library.path in intelliJ Idea

Could anyone please help how do I solve this error:

Native code library failed to load. java.lang.UnsatisfiedLinkError: no ts-jni in java.library.path 

I am using IDEA IDE as a first time, and have been using Resin_4.0.37 as a server to test my work. As soon as I start my lcoal server in debug mode it stays for approximately 1-2 mins and then suddenly it drops down and get disconnected by giving me the above error.

I have set my Windows environmental variable correctly; and have also did the following in my IDE intelliJ:

 FILE->Project Structure->set Global Libraries->a. Java path and b. Resin library path. 

Can any one please suggest me, what am I doing wrong and how do I set native library in intelliJ IDEA to solve the mentioned error.

Any help would be appreciated. Also do correct me if I am doing something wrong.

Thanks!

like image 873
AKIWEB Avatar asked Oct 10 '13 23:10

AKIWEB


People also ask

Where do I put libraries in IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

How do I get to java build path in IntelliJ?

Select a module or a project you want to compile and from the main menu, select Build | Build Project ( Ctrl+F9 ). IntelliJ IDEA displays the compilation results in the Review compilation and build output.


1 Answers

If you run your program from IntelliJ then you can set the java.library.path in the VM options input field in the Run/Debug Configurations dialog.

enter image description here

Example:

-Djava.library.path="C:\path\to\where\the\jni\lib\is"

like image 69
maba Avatar answered Oct 12 '22 03:10

maba