Tuesday, September 22, 2015

How to solve libXtst.so.6: cannot open shared object file: No such file or directory, running JDeveloper on ubuntu 14

If you are using JDeveloper on a Ubuntu machine and you get the following error:
 
user@user:~/Oracle/Middleware_1104/jdeveloper/jdev/bin$ ./jdev

Oracle JDeveloper 11g Release 2 (11.1.2.4.0)
Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/user/Oracle/Middleware_1104/jdk160_24/jre/lib/i386/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1003)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1723)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
    at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
    at java.awt.Component.<clinit>(Component.java:567)
    at oracle.ide.osgi.boot.OracleIdeLauncher.main(OracleIdeLauncher.java:87)
    at oracle.ide.osgi.boot.JDeveloper.main(JDeveloper.java:14)


You will need to install libxtst6 lib:

user@user:~/Oracle/Middleware_1104/jdeveloper/jdev/bin$ sudo apt-get install libxtst6:i386
 

How to install Maven on Ubuntu 14?

Firstly, download Maven Tar file from: https://maven.apache.org/download.cgi

Now under console follow the next commands:

user@user:~$ sudo tar -zxvf apache-maven-3.2.5-bin.tar.gz
user@user:~$ sudo mkdir -p /usr/lib/apache/maven/3.2.5/
user@user:~$ sudo mv apache-maven-3.2.5 /usr/lib/apache/maven/3.2.5
user@user:~$ cd /usr/lib/apache/maven/3.2.5/


Secondly, edit profile file:

user@user:~$ sudo gedit /etc/profile

Add the following lines at the end of the file in the above file:
-----

MAVEN_HOME=/usr/lib/apache/maven/3.2.5/apache-maven-3.2.5
PATH=$PATH:$MAVEN_HOME/bin
export MAVEN_HOME
export PATH
 

----

Execute profile to run the previous changes:

user@user:~$ source /etc/profile

Next of prove the configuracion trying version option of maven:


user@user:~$ mvn -ver

Monday, September 21, 2015

How to Install JDK on Ubuntu 14?

First off download JDK 6
You will get a bin file with the version you may choose by this time I have choose 'jdk-6u45-linux-x64.bin', after we will execute the program and move to another proper directory:

user@user:~$ chmod +x jdk-6u45-linux-x64.bin
user@user:~$ ./jdk-6u45-linux-x64.bin
user@user:~$ sudo mkdir /usr/lib/jvm/
user@user:~$ sudo mv jdk1.6.0_45/ /usr/lib/jvm/


Next of put directory as update alternatives with the priority 1

user@user:~$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java" 1
user@user:~$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac" 1
user@user:~$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws" 1



Securily, regard a correct alternatives on java program and check if there is installed the correct option in the system

user@user:~$ sudo update-alternatives --config java
user@user:~$ sudo update-alternatives --config javac
user@user:~$ sudo update-alternatives --config javaws


user@user:~$ which java
user@user:~$ which javac
 
user@user:~$ which javaws

Edit the next file and add the following lines at the end of the script:


sudo gedit /etc/profile
----------


JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/lib/jvm/jdk1.6.0_45/jre
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH


---------
Finally execute profile to load variable system

 . /etc/profile

update: 25/06/2016

Add reference to jar:

sudo alternatives --install /usr/bin/jar jar /opt/jvm/jdk1.8.0_91/bin/jar 2
sudo alternatives --install /usr/bin/javac javac /opt/jvm/jdk1.8.0_91/bin/javac 2
sudo alternatives --set jar /opt/jvm/jdk1.8.0_91/bin/jar
sudo alternatives --set javac /opt/jvm/jdk1.8.0_91/bin/javac

 

Sunday, September 13, 2015

How to kill Weblogic Server from console?

If you are wondering how to kill a weblogic instance from console, here are the instructions to try on:


[osh@osh-ThinkPad-T430 bin]$ ps aux | grep 'weblogic'
root     10219  141  4.9 3709388 793312 pts/0  Sl+  14:09   2:05 /home/osh/Oracle/Middleware/Oracle_Home/oracle_common/jdk/bin/java -Dprod.props.file=/home/osh/Oracle/Middleware/Oracle_Home/wlserver/.product.properties -Dweblogic.wlstHome=/home/osh/Oracle/Middleware/Oracle_Home/oracle_common/common/wlst: -DORACLE_HOME=/home/osh/Oracle/Middleware/Oracle_Home/oracle_common -DCOMMON_COMPONENTS_HOME=/home/osh/Oracle/Middleware/Oracle_Home/oracle_common -Xms32m -Xmx1024m -XX:MaxPermSize=384m -Dweblogic.alternateTypesDirectory=/home/osh/Oracle/Middleware/Oracle_Home/oracle_common/modules/oracle.ossoiap_12.1.3,/home/osh/Oracle/Middleware/Oracle_Home/oracle_common/modules/oracle.oamprovider_12.1.3,/home/osh/Oracle/Middleware/Oracle_Home/oracle_common/modules/oracle.jps_12.1.3 weblogic.WLST /root/.jdeveloper/system12.1.3.0.41.140521.1008/o.j2ee.adrs/BuildDefaultDomain1.py
osh      10689  0.0  0.0 112640   960 pts/1    S+   14:10   0:00 grep --color=auto weblogic


[osh@osh-ThinkPad-T430 bin]$ kill -9 10219

After of press an enter key the weblogic should be shutdown.