Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
302 views
in Technique[技术] by (71.8m points)

native - Java Problem "UnsatisfiedLinkError"

I made a simple java program that sends bytes to the parallel port, which uses a .dll along with two other classes (pPort.java and ioPort.java) to accomplish it, and it works perfectly fine.

However, I started making another program on NetBeans IDE which has a similar function. It compiles perfectly, but when I run it I get:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: parallelporttimer.ioPort.Out32(SS)V

From what I understand, it's failing to call the .dll file I put on System32. But I don't understand why, since the other program, which is basically the same but made manually without any IDE, runs fine. Do I have to specify something in NetBeans for this to work? Any help with this would be greatly appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

DLL needs to be in the path or current working directory in order to be loaded.

I'm guessing when you've ran your program without IDE the latter was the case. When you run it from within NetBeans "working" directory is likely netbeans/bin folder, so DLL can't be found. Add its location to path and you should be good to go.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...