1

So I downloaded JNativeHook 1.1.4 from

Link for JNativeHook

And then I added it to my build path and compiled the program. I tested the program on my Linux VPS and get this error.

[root@nl ~]# java -jar file.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError:     
/tmp/libJNativeHook_468389387164048348.so: libXt.so.6: cannot open shared object file: No such file or directory

The program was compiled using Java 1.6 and my VPS is running.

[root@nl ~]# java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

How can I get my program to work on Linux?. The program is working fine on Windows.

When i run yum whatprovides '*/libXp.so.6 I get this.

libXp-1.0.0-15.1.el6.x86_64 : X.Org X11 libXp runtime library
Repo        : base
Matched from:
Filename    : /usr/lib64/libXp.so.6
John
  • 29
  • 2
  • 2
    The Java library extracts some native code which in turn depends on an OS library that can't be found. You need to take steps to make _libXt.so.6_ visible to the process. [Here's a similar question](http://stackoverflow.com/questions/17355863/cant-find-install-libxtst-so-6). – McDowell Jul 24 '14 at 18:58
  • @McDowell I'm using a centos VPS, and those commands aren't working. How can I make libXt.so.6 visible on any Linux machine? – John Jul 24 '14 at 19:14
  • Try `yum whatprovides '*/libXp.so.6'`. With any luck you'll be able to use `yum install libXp.so.6`. There won't be a universal package management mechanism that works on every Linux distro. – McDowell Jul 24 '14 at 19:24
  • @McDowell Updated the post with the result. I also installed it using yum install libXp.so.6. – John Jul 24 '14 at 19:28
  • Install libXp with `yum install libXp.so.6` – McDowell Jul 24 '14 at 19:30
  • I installed it. Would I have to do this on every Linux machine? – John Jul 24 '14 at 19:35
  • "Linux" is not a standardized system from a single vendor with a common way to provide libraries. You have some transitive X11 dependencies that may or may not be available on an arbitrary Linux system. Apart from "test + document for popular distributions" there are no simple answers. – McDowell Jul 24 '14 at 20:03
  • For a complete list of dependencies and detailed complication instructions, please see the [wiki on github](https://github.com/kwhat/jnativehook/wiki/How-to-build-JNativeHook-from-source#system-requirements-2). If you're building form src, please consider building the trunk. Version 1.1 has a lot of problems in it that have already been resolved. Version 1.2 RC 1 is a little late, but binaries should be ready as soon as I finish up a few of the [outstanding issues](https://code.google.com/p/jnativehook/issues/list). – Alex Barker Jul 25 '14 at 17:56

0 Answers0