0

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?

cookick
  • 1
  • 1

1 Answers1

0
  1. The bashrc and other profile based scripts like bash_profile etc., that are executed on login are different for different users. Maybe the root users bashrc does not have this JAVA_HOME or might have a different version altogether. So make sure the files in the home directory of both these users are have the same version. For more information you can check What's the difference between .bashrc, .bash_profile, and .environment?

  2. The error states that symbol initInetAddressIDs version SUNWprivate_1.1 not defined in file libnet.so. This might be an issue of java setup. The .so libraries being fetched might be mixed up. It might work once you fix up 1st issue.

deepakchethan
  • 5,240
  • 1
  • 23
  • 33
  • Can you please re-read my first question as I edited a bit? My root account has the correct java -version which I set using sudo update-alternatives --set java , but my user account does not have the correct java -version. Thank you. – cookick Jun 04 '21 at 10:51
  • Can you share the article that you used to setup @cookick? – deepakchethan Jun 04 '21 at 10:56
  • There are 2 links: https://dev.to/ishakantony/how-to-install-oracle-sql-developer-on-ubuntu-20-04-3jpd https://docs.datastax.com/en/jdk-install/doc/jdk-install/installOracleJdkDeb.html @deepakchethan – cookick Jun 04 '21 at 11:04