Can't find/install libXtst.so.6? - java

I'm running Ubuntu 12.10 and I'm trying to install Netbeans 7.1(or later)
I have the .sh file, but it won't install, the error appears here:
[2013-06-27 19:11:28.918]: at org.netbeans.installer.Installer.main(Installer.java:81)
[2013-06-27 19:11:28.918]: An error occured while initializing the NetBeans IDE installer UI.
[2013-06-27 19:11:28.918]: Most probably the running JVM is not compatible with the current platform.
[2013-06-27 19:11:28.919]: See FAQ at http://wiki.netbeans.org/FaqUnableToPrepareBundledJdk for more information.
[2013-06-27 19:11:28.919]: /usr/local/java/jre1.7.0_25/lib/i386/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
[2013-06-27 19:11:28.919]:
[2013-06-27 19:11:28.919]: Exception:
[2013-06-27 19:11:28.919]: java.lang.UnsatisfiedLinkError:
[2013-06-27 19:11:28.919]: /usr/local/java/jre1.7.0_25/lib/i386/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
[2013-06-27 19:11:28.919]:
[2013-06-27 19:11:28.919]: You can get more details about the issue in the installer log file:
[2013-06-27 19:11:28.919]: /root/.nbi/log/20130627191128.log
I don't have the libXtst.so.6 file in any directory, and I can't seem to find it anywhere to download. Has anyone else run into this problem, or know a work around?

EDIT: As mentioned by Stephen Niedzielski in his comment, the issue seems to come from the 32-bit being of the JRE, which is de facto, looking for the 32-bit version of libXtst6. To install the required version of the library:
$ sudo apt-get install libxtst6:i386
Type:
$ sudo apt-get update
$ sudo apt-get install libxtst6
If this isn’t OK, type:
$ sudo updatedb
$ locate libXtst
it should return something like:
/usr/lib/x86_64-linux-gnu/libXtst.so.6 # Mine is OK
/usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0
If you do not have libXtst.so.6 but do have libXtst.so.6.X.X create a symbolic link:
$ cd /usr/lib/x86_64-linux-gnu/
$ ln -s libXtst.so.6 libXtst.so.6.X.X

This worked for me in Luna elementary OS
sudo apt-get install libxtst6:i386

Your problem comes from the 32/64 bit version of your JDK/JRE... Your shared lib is searched for a 32 bit version.
Your default JDK is a 32 bit version. Try to install a 64 bit one by default and relaunch your `.sh file.

Had that issue on Ubuntu 14.04, In my case I had also libXtst.so missing:
Could not open library 'libXtst.so': libXtst.so: cannot open shared object
file: No such file or directory
Make sure your symbolic link is pointing to proper file,
cd /usr/lib/x86_64-linux-gnu and list libXtst with:
ll |grep libXtst
lrwxrwxrwx 1 root root 16 Oct 7 2016 libXtst.so.6 -> libXtst.so.6.1.0
-rw-r--r-- 1 root root 22880 Aug 16 2013 libXtst.so.6.1.0
Then just create proper symbolic link using:
sudo ln -s libXtst.so.6 libXtst.so
List again:
ll | grep libXtst
lrwxrwxrwx 1 root root 12 Sep 20 10:23 libXtst -> libXtst.so.6
lrwxrwxrwx 1 root root 12 Sep 20 10:23 libXtst.so -> libXtst.so.6
lrwxrwxrwx 1 root root 16 Oct 7 2016 libXtst.so.6 -> libXtst.so.6.1.0
-rw-r--r-- 1 root root 22880 Aug 16 2013 libXtst.so.6.1.0
all set!

I had this issue with CentOS 8 and all of the packages above did not solve my problem. When I reviewed the two folders that store these files (for 64 bit /usr/lib64/ vs 32 bit /usr/lib/) I found that the 64-bit folder did not have libXt (but I was on a 64 bit OS). So I ran:
yum install -y libXt.x86_64
And this resolved my problem. libXt.so.6 was now in that directory.

Related

How i can export a WindowBuilder to use it in a MacOSX

I created a calculator and exported it using:
Project > Export > Runnable JAR file
I selected the option Package required libraries into generated JAR.
It works in my own PC but when I send the .jar to my MACOSX it doesn't work.
When I gave permissions to the project and clicked it again it drop the next message
I tried to install JRE and used
$ ls -l#
-rw-r--r--#
1 dave staff 17663235 13 Oct 11:08 server-0.28.2-java8.jar
com.apple.metadata:kMDItemWhereFroms 619 com.apple.quarantine
68
and deleted the atributes with
xattr -c file.jar
It doesn't work. What's wrong with my procedure ?

Java in usr/bin/java missing

I can locate java in my machine in etc/alternatives/java(link to executable file to /usr/local/java/jdk1.8.0_201/bin/java where I can see executable java file).
Kindly please help me to move this java file to usr/bin/java directory.
As lot of dependant applications are failing to run because of this.
Thanks
Pritam
This is because there are some 32-bit libraries missing in your Ubuntu 64-bit. Run:
apt-get install libc6-i386
This is the setup you are looking for. I am surprised that the install process didn't do this for you. You need the Unix ln -s command.
$ file /usr/bin/java
/usr/bin/java: symbolic link to /etc/alternatives/java
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Apr 18 2018 /usr/bin/java -> /etc/alternatives/java

Multiple Java versions on CentOS

I have installed JAVA 1.7_80 in my centOS machine, but when I check the Java version it shows 1.7_09.
I ran the ./java -version in the installation directory which correctly shows 1.7_80, but the global java -version is 1.7_09.
Please refer the link for image -
https://scontent.xx.fbcdn.net/hphotos-xft1/v/t1.0-9/11667333_914348581933741_3461411661734554342_n.jpg?oh=e8d3037e2f6492757b0f786bd0ae8f77&oe=56318F12
Does someone know what could be the cause or how to fix this?
There's default OpenJDK in CentOS,
OPTION A
You have to install JDK with alternatives.
# cd /opt/jdk1.8.0_101/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_101/bin/java 2
# alternatives --config java
THE OUTPUT ==>
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
1 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64/jre/bin/java
+ 2 /opt/jdk1.8.0_101/bin/java
Enter to keep the current selection[+], or type selection number:
Select the version you want from this list.
OR : OPTION B
#ls -l /usr/bin/java
OUTPUT : . 1 root root 22 සැප් 9 02:09 /usr/bin/java -> /etc/alternatives/java
then # ls -l /etc/alternatives/java
OUTPUT : . 1 root root 26 සැප් 9 02:09 /etc/alternatives/java -> /opt/jdk1.8.0_101/bin/java
#unlink /etc/alternatives/java
#ln -s <new location> /etc/alternatives/java
(ln -s <original file> <link to file> )
But I prefer the option A.

Cannot find jdeps command (Mac)

I'm using Java 8 update 45 on my mac.
I've tried to use 'jdeps' command, but my mac keeps showing "command not found" message. Weird thing is that other command in the bin folder like 'java', 'javac' perfectly works. Only 'jdeps' command is not working.
How can I use jdeps command? Is there any condition to use this command?
It's definitely there in the version I have on Mac:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin
The crux the it seems to be that some of the things in the above don't get the magic mentioned below:
http://lists.apple.com/archives/java-dev/2015/Nov/msg00009.html
When the JAVA_HOME environment variable is set Mac OS X does some magic
But the problem is not all the commands are covered, and some are missing from newer JDKs
The links don't appear in:
$ ls -l `which java`
lrwxr-xr-x 1 root wheel 74 1 Jul 2014 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk_version/Contents/Home
export PATH=${PATH}:${JAVA_HOME}/bin

"Error: JAVA_HOME is not defined correctly." in building Jikes rvm

When I built the Jikes RVM on Ubuntu, I got this error. Any idea?
bin/buildit localhost production
---> Config: production
/bin/bash --login -c '/bin/bash --login -c " cd /home/jack/Programs/jikesrvm-3.1.2 && export JAVA_HOME=/opt/jdk1.6.0 && ant very-clean -Dhost.name=ia32-linux && ant check-components-properties -Dhost.name=ia32-linux -Dtarget.name=ia32-linux -Dcomponents.cache.dir=/home/jack/.buildit_components_cache && ant -Dtarget.name=ia32-linux -Dconfig.name=production -Dhg.revision= -Dhost.name=ia32-linux -Dcomponents.cache.dir=/home/jack/.buildit_components_cache "'
Error: JAVA_HOME is not defined correctly.
We cannot execute /opt/jdk1.6.0/bin/java
Wed Jun 13 12:23:37 EDT 2012
===================== Summary =====================
Local : /home/jack/Programs/jikesrvm-3.1.2
Build : ubuntu:/home/jack/Programs/jikesrvm-3.1.2
Target : ubuntu:/home/jack/Programs/jikesrvm-3.1.2
Start : Wed Jun 13 12:23:37 EDT 2012
Config : production [FAILED Wed Jun 13 12:23:37 EDT 2012]
===================================================
OS:
Linux ubuntu 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686 GNU/Linux
Environmental Variables:
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun-1.6.0.22/bin<
JAVA_HOME
/usr/lib/jvm/java-6-sun-1.6.0.22
I checked the java in the JAVA_HOME/bin directory, it works.
No matter how I change the environmental variables, the error kept complaining
"We cannot execute /opt/jdk1.6.0/bin/java".
It seems that I didn't modify the right "position".
run this command:
find . -exec grep "jdk1.6.0" {} \;
To find out which file is setting JAVA_HOME to that path.
While you build jikes you can either build it using ant or using the command you are using.
If the JAVA_HOME problem is causing trouble use
bin/buildit localhost production -j"path to your jvm directory"
-This is present in "/usr/bin/jvm".
Another method: There is bin/buildit.base_config in which path for JAVA_HOME is specifically mentioned. So under "# Default JAVA_HOME values" you can modify appropriate location, for example,
global.javahome.ppc32-linux=/usr/lib/jvm/java-6-sun-1.6.0.26
global.javahome.ppc64-linux=/usr/lib/jvm/java-6-sun-1.6.0.26
global.javahome.ia32-linux=/usr/lib/jvm/java-6-sun-1.6.0.26
global.javahome.x86_64-linux=/usr/lib/jvm/java-6-sun-1.6.0.26
You can chose which you want to use. If not familiar with your architecture, modify all and now you can build without having to worry about your java path to be mentioned explicitly.
For more detailed information check this blog
I have also written a small article on how one can start to fiddle with Jikes
It's JRE but not JDK. Install JDK and make JAVA_HOME pointing to it.
You might get this error due to couple of reasons. To fix this quickly please follow below steps,
First find the java location. To get a list of your installed Java platforms, run the following command from the terminal:
$ sudo update-alternatives --config java
Now set JAVA_HOME and PATH,
$ export JAVA_HOME=<java_home>
$ export PATH=$JAVA_HOME/jre/bin:$PATH
Create the symlink
$ sudo ln -s <java_home>/jre <java_symlink_path>
When we take your case as a example :
$ sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.22/jre /opt/jdk1.6.0
Above command will create the symlink location where the system is trying to find in your issue.
Finally do the try your app.

Categories