java.lang.UnsatisfiedLinkError: on Linux but not Windows - java

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

Related

WSL-2 Ubuntu 20.04 JavaFX error while using Java 8

I am using WSL-2 Ubuntu 20.04 on windows10 and I want to run a java application on it but I get the following error:
Error: JavaFX runtime components are missing, and are required to run
this application
It is strange because I have installed Java 8 which has JavaFX included.
java -version gives me back the following:
java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
javac -version
javac 1.8.0_312
I am running the java program in the following way:
java -jar myprogram.jar
What do I miss?

Can't run java applications

I have trouble when trying to open my jar files with the following command:
java -jar software.jar
They load until a certain point and then nothing happens.
I deinstalled default-jdk and OpenJDK with synaptic and re-installed it with apt-get, but nothing changed. I had a similar problem one month ago and solved it (apparently only temporarly) by deleting the package gcj-5-jre-lib (5.4.0-6ubuntu1~16.04.4) (Java runtime library for use with gcj (jar files))
The following outputs will help:
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
javac -version
1.8.0_131
My variables $JAVA_HOME and $JRE_HOME were correctly added to my $PATH.
I'm on Ubuntu 16.04
EDIT
Here is an example of what I get when I try to start PhyDE.jar
java -jar PhyDE.jar
Welcome to PhyDE 0.9971!
Reading preferences.
Creating PhyDE-Application window
Checking for updates...
You are using the latest version of PhyDE
Done with checking for updates
When checking the core use with the command top I see that the process is active, but the user interface does not open as it usually does. I am located in the folder where the jar file is, and same happens with other jar files.

installation error for elasticsearch on windows7

I have been trying to setup elasticsearch in windows7 machine by following https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html
I was able to download, unzip but when running ./elasticsearch, I get the below error,
Error: Could not find or load main class
org.elasticsearch.tools.JavaVersionChecker
Elasticsearch requires at least Java 8 but your Java version from C:\Program
Files\Java\jdk1.8.0_131/bin/java does not meet this requirement
I have verified Java versions installed and they look fine,
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
$ javac -version
javac 1.8.0_131
Can someone point out where I am wrong ?
In run Elasticsearch in Windows, you should run with elasticsearch.bat not ./elasticsearch directly:
And now we are ready to start our node and single cluster (Windows users should run the elasticsearch.bat file):
Seems like you don't have right permissions. Try to set them to 774 and check again:
sudo chmod 774 -R elasticsearch-6.3.2/

Ionic on Ubuntu get java error when run "ionic emulate android" command

I cannot run the "ionic emulate android" command.
I keep getting following error message:
I have already installed the java,
when I run "java -version", i got this
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
when I run "which java", I got this
/usr/bin/java
Is anyone, have an idea why am I getting this error?
I'm using Ubuntu 14.04.
Thanks in advance!
Ionic can't find your Java executable.
Try to make it accessible in your PATH:
export JAVA_HOME="your/path/to/jdk"
You can also try to put this line in /etc/environment and load it with:
source /etc/environment
as it is suggested in this post:
How to set JAVA_HOME for Java?

Android Studio Crash on Fedora 22

I'm trying to run Android Studio in my Fedora22 machine. I've followed the instructions in the site, downloaded the zip, extracted it and ran studio.sh file.
It opens the Android Studio correctly, but after the download of components starts, it just closes without showing any dialogbox with the error.
As I'm running through the terminal, I saw the following error before the program gets closed:
/home/mlima/android-studio/bin/studio.sh: line 188: 30819 Aborted
(core dumped) LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH"
"$JDK/bin/java" $AGENT "-Xbootclasspath/a:$IDE_HOME/lib/boot.jar"
-classpath "$CLASSPATH" $VM_OPTIONS "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED"
"-XX:ErrorFile=$HOME/java_error_in_STUDIO_%p.log" -Djb.restart.code=88
-Didea.paths.selector=AndroidStudio1.4 $IDE_PROPERTIES_PROPERTY $IDE_JVM_ARGS $REQUIRED_JVM_ARGS $MAIN_CLASS_NAME "$#"
My javac -version: javac 1.8.0_60-debug
Thanks
Try to reinstall javac java -version is:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
And it work.
If this doesn't resolve the problem you have to find the way to set your environment HomePath variable points the current java sdk path.
Hope this can help, bye

Categories