Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkError #23

Closed
pdzzzn opened this issue Feb 8, 2018 · 7 comments
Closed

LinkError #23

pdzzzn opened this issue Feb 8, 2018 · 7 comments

Comments

@pdzzzn
Copy link

pdzzzn commented Feb 8, 2018

I built a .jar from modules with dependencies and moved it to a different pc which has winpcap etc installed. Whenever I run "java -Xmx1024m -jar /D:/jar.jar" I get the following error:

Connected to the target VM, address: '127.0.0.1:51706', transport: 'socket' Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\s\AppData\Local\Temp\jna-105006804\jna17563392344963319234.dll: Can't find dependent libraries at java.base/java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2614) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2499) at java.base/java.lang.Runtime.load0(Runtime.java:812) at java.base/java.lang.System.load(System.java:1821) at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851) at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826) at com.sun.jna.Native.<clinit>(Native.java:140) at com.sun.jna.Pointer.<clinit>(Pointer.java:41) at com.sun.jna.ptr.PointerByReference.<init>(PointerByReference.java:28) at com.sun.jna.ptr.PointerByReference.<init>(PointerByReference.java:24) at org.pcap4j.core.Pcaps.findAllDevs(Pcaps.java:48) at pubg.radar.sniffer.Sniffer.<clinit>(Sniffer.kt:68) at pubg.radar.GameKt.main(Game.kt:41) Disconnected from the target VM, address: '127.0.0.1:51706', transport: 'socket'

@Norxy
Copy link

Norxy commented Feb 8, 2018

Try to install java sdk 8, or try to rebuild the .jar on the pc you want to run it

@pdzzzn
Copy link
Author

pdzzzn commented Feb 8, 2018

Still the exact same error, regardless whether or not I just install it or rebuild it with jdk8.

@Norxy
Copy link

Norxy commented Feb 8, 2018

I had the same problem before, I added java to the path and did the M3/M3_HOME changes and it works now

@pdzzzn
Copy link
Author

pdzzzn commented Feb 8, 2018

Sounds promising. Care to elaborate?
I'm guessing you mean the environment variables. I'm pretty sure I have them set, but I'll recheck. What do you mean with M3/M3__HOME ? Couldn't find anything on google.

@Norxy
Copy link

Norxy commented Feb 8, 2018

the environment variables

M3 = your path to maven/bin folder
M3_HOME= your path to maven folder

after you did that open cmd type mvn -version to check everything is correct and you can build it using mvn package

@pdzzzn
Copy link
Author

pdzzzn commented Feb 9, 2018

Added all the environment variables you suggested with the corresponding packages. Still not working unfortunately.
Whenever I run the .jar on my main computer, it works fine. It works neither on my laptop nor on a VM. On both I get the error message I posted in OP.
I'll double check later tonight when I get home what environment variables I have set on my home pc. Maybe comparing the two will help.
Do you have any other suggestions?

@do1234521
Copy link

Same problem like @pdzzzn , the complied file works on one computer but not working on anther, very strange. I'm using the same orcale JDK 9.04 on win10, tried JDK8 but not work. Any one have ideas ?

errors showing
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\user\AppData\Local\Temp\jna-3321552\jna3756641772474147785.dll: Can't find dependent libraries
I think the main problem is : at org.pcap4j.core.Pcaps.findAllDevs(Pcaps.java:48)
that is the Pcaps is not linked in the package, any one have idea to solve that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants