I installed Oracle SQL Developer following an article online in my Virtual Box Ubuntu.
My Ubuntu has IBM ACE 11 Developer Edition installed. So when I type java -version at terminal (user), I got this:
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 8.0.6.20 - pxa6480sr6fp20ifix-20210224_01(SR6 FP20+IJ30974))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20210223_466229 (JIT enabled, AOT enabled)
OpenJ9 - 5b31a42
OMR - 4eb8f5f
IBM - b7e48f4)
JCL - 20201119_01 based on Oracle jdk8u271-b0
But in my root terminal , my java -version is
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
JAVA_HOME in both .bashrc and /etc/profile are set to usr/lib/jvm/jdk1.8.0_291 (newly downloaded JDK as per the article)
First question is why I have set those JAVA_HOME path to the same one, but java -version in user account is not the JDK that I installed newly.
# update-alternatives --list java
/opt/IBM/ace-11.0.0.12/common/jdk/jre/bin/java
/usr/lib/jvm/jdk1.8.0_291/bin/java
I have set to use the newly installed java (/usr/lib/jvm/jdk1.8.0_291/bin/java) using the sudo command update-alternatives --set java ....
I am able to start sqldeveloper using root. But not able to start sqldeveloper using user account where I have set the SetJavaHome to newly installed Java path.
I tried this https://askubuntu.com/questions/566721/sql-developer-runs-in-terminal-with-sudo-sqldeveloper-but-not-without-sudo where it asked to change the file ownership. But still it doesn't work
I got error when trying to start sqldeveloper
Oracle SQL Developer
Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
/usr/lib/jvm/jdk1.8.0_291/bin/java: relocation error: /usr/lib /jvm/jdk1.8.0_291/jre/lib/amd64/libnio.so:
symbol initInetAddressIDs version SUNWprivate_1.1 not defined in file libnet.so with link time reference
Second question is how can I approach to solve the error when starting sqldeveloper without using root?