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?
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?
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.
Related
Good day,
I'm trying to install "Teradata Studio" on my Mac. This is a software for working with Teradata database.
However, at the end of installation I get an error "Java Runtime Environment 1.8 or 10 is required and should be installed before installing Teradata Studio Application."
Can anyone please tell me what can I do about it? I already installed Java 1.8.
output of terminal commands
"/usr/libexec/java_home -V"
Matching Java Virtual Machines (3):
14, x86_64: "Java SE 14" /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home
13.0.2, x86_64: "Java SE 13.0.2" /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home
1.8.0_201, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
.bash_profile content:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
So, looks like I already have Java 1.8.
Any ideas why it's not working?
Step 1: Get Java
You can download and install many different versions of Java, including Java 11 for mac from here:
https://www.azul.com/downloads/zulu-community/?package=jdk
Step 2: Check your version
Use the command java --version to identify which version of Java is currently active.
Step 3: Remove other versions of Java
If the version you just installed isn't showing, you may have multiple versions of Java installed on your machine. In this case you may need to remove existing versions of Java that are not the version you want. For Mac, java is typically installed in this directory:
/Library/Java/JavaVirtualMachines
To delete a version of Java from your machine, use the command "sudo rm -r directory" where directory is the name of the directory you want to remove.
Step 4: Repeat until done
Repeat steps 2 and 3 until your desired version of Java shows up during step 2. then try installing your software.
I am getting below result, Does it mean I am having JDK 1.7.0_45 and JRE is 1.42 ? Please advise.
$ javac -version
Eclipse Java Compiler v_677_R32x, 3.2.1 release, Copyright IBM Corp 2000, 2006. All rights reserved.
$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
$ alternatives --config java
There is 1 program that provides 'java'.
Selection Command
-----------------------------------------------
*+ 1 **/usr/lib/jvm/jre-1.4.2-gcj/bin/java**
Enter to keep the current selection[+], or type selection number:
It would appear that you have two versions of Java installed:
The Java on your PATH is Java 1.7.0. I think it is an Oracle build rather than a build from your Linux system's package repository.
The Java configured using alternatives looks like a GCJ Java that is compatible with Java 1.4.2. It was probably installed from your package repository. IMO, it is inadvisable to use this from a technical standpoint. In fact, I would recommend uninstalling it.
Actually I am getting "Unsupported major.minor version 51.0" error after uploading a external jar file to Informatica powercenter Java transformation.
That implies that Informatica is using the Java 1.4.2 installation.
Now, the version of Java that an application uses will depend on what version of Java the application's launcher / launch script is using. That could depend on a number of things:
If the launcher uses an absolute path for the java command, then that is what will use.
If the launcher uses a simple name (e.g. java) then the version used will depend on the launcher's $PATH. This is probably what is happening ... and the $PATH used is different from your shell's $PATH.
So what is the solution?
You could add the Oracle Java install to the alternatives system. See man alternatives or Google for instructions using "java oracle alternatives install"
You could tweak the $PATH used by the application's launcher.
Depending on your Linux distro, you could install an OpenJDK 1.7.0 JDK or JRE from the package repos. That will (should) add the new installed Java to the alternatives database, so that you can select it instead of the old GCJ 1.4.2 installation.
I upgraded java on my osx 10.9.4 machine using the suggested method from the java web site
It successfully updated, but when trying to run Eclipse I get an error:
Version 1.6.0_65 of the JVM is not suitable for this product.
Version 1.7 or greater is required.
When I access java settings through the applet in the control panel, it shows Java 7 Update 65, but when I type java -version in the console, it shows 1.6.0_65 (response shown below):
| => java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
As far as I know, there is only one java on the box. "which java" returns /usr/bin/java and type -a java returns only /usr/bin/java also. /usr/bin/java is obviously the older version, but I'd like to use the updated one. Can someone please tell me how to update the /usr/bin/java version and/or how to link the applet version so that Eclipse will use the updated one?
Take a look at oracle documentation here:
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
It says:
To run a different version of Java, either specify the full path, or
use the java_home tool:
/usr/libexec/java_home -v 1.7.0_06 --exec javac -version
The /usr/libexec/java_home is a link to your jdk directory that should be located under:
/Library/Java/JavaVirtualMachines/jdk<major>.<minor>.<macro[_update]>.jdk
I think your java_home link is pointing to your jdk6. You can check it doing a ls -l /usr/libexec/
I'm trying to install JDK 1.7 update 21 on Mac OSX 10.7 .
I downloaded the installer from oracle site (as dmg file). ran the installer which completed successfully.
Now I can't find the java SDK anywhere on the file system.
The output of /usr/libexec/java_home -V is :
***/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home***
which is the previous version installed.
also running java -version executes the same old version.
***Java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)***
In the java control panel I do see that the JRE has updated to Java 1.7 for the browser but there aren't any details regarding the JDK there.
Where can I find the new JDK on the file system and how do I set it as default ?
Is there any log file for the installation that I can use to debug ?
Try adding this to your shell startup script (.bash_profile off of ~ if you are using bash):
export JAVA_HOME=`/usr/libexec/java_home -v '1.7*'`
The changeover from Apple providing the JDK to Oracle has been a complete disaster.
Ok, I'm trying to install Websphere (from IBM) on my Ubuntu 12.04 LTS Server.
But when it cames to install the .bin, it says no Java VM can be found on the server, but when I get the Java version it's fine.
Here's the response I get when I run this commands:
$ sudo path/*.bin
Preparing to install ...
Extracting the installation resources from the installer archive..
Configuring the installer for this system's environment...
no Java virtual machine could be found from your PATH environment variable. You must install a VM prior to running this program.
$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pxi3260sr12-20121025_01(SR12))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr12-20121024_126067 (JIT enabled, AOT enabled)
J9VM - 20121024_126067
JIT - r9 20120914_26057
GC - 20120925_AA)
JCL - 20121014_01
$ cat /etc/environment
JAVA_HOME="/opt/ibm/java-i386-60"
JRE="$JAVA_HOME/jre"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/imb/java-i386-60/bin:/opt/ibm/java-i386-60/jre/bin"
When you use sudo, the command is run as root and not as the current user. You need to configure root's $PATH to include Java.
Try sudo java -version to see if Java is property configured for root (it sounds like it isn't).