Ubuntu 16.04: Oracle JDK 9 is NOT installed - java

Every time I try to install something from terminal this message pops up to me. Meanwhile I have my Java installed right:
download failed
Oracle JDK 9 is NOT installed.
dpkg: error processing package oracle-java9-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java9-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
Please can someone help me solve this; it's really annoying.

sudo apt-get purge oracle-java9-installer
solved my issue.
Later I also changed Ubuntu Software center server to "Main Server".

Actually I hit the issue after resolving the wine installation on my Ubuntu 16.04 LTS box. The wine issue I resolved using the below link.
https://askubuntu.com/questions/935050/unknown-error-class-keyerror-the-cache-has-no-package-named-wine1-6-i38
So that landed me to this post. But I was not able to install the java from apt packages. It threw me errors. Then I realized it was the issue of having multiple Java instances on my system. I already had Oracle Java 9 installed. I just needed to change the current verions using the command
sudo update-alternatives --config java
So if any body hits the error, you can try setting this.

I was getting the same error so using this command first i removed Java 9
sudo apt remove oracle-java9-installer
Then I made Java 8 as default
sudo apt-get install oracle-java8-set-default
After this if you try to install other software it will work or you can also upgrade Java 8 to Java 9.

First, add Oracle's PPA, then update your package repository.
$sudo add-apt-repository ppa:webupd8team/java
$sudo apt-get update
To install JDK 9, use the following command:
$sudo apt-get install oracle-java9-installer

I'm not sure what steps you have tried already to install it but the link below is a fairly well explained description of how to install the JDK on Ubuntu. I've always installed the JDK through the webupd8team's ppa and its worked for me so far :)
A note about the link, it suggests setting the home variable, this may be necessary for you but I've never had to it manually and it's worked so give it a quick check before setting the home variable yourself.
https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

Solved the problem removing all java versions and purging them and re-installing them again probably, thanks everyone who tried to help.

Completely removal criteria:
To remove Oracle JDK completely, run the commands below:
sudo apt-get remove oracle-java9-installer
sudo apt-get remove --auto-remove oracle-java9-installer
sudo apt-get purge oracle-java9-installer
sudo apt-get purge --auto-remove oracle-java9-installer
Resource Link:
https://www.howtoinstall.co/en/ubuntu/trusty/tomcat7?action=remove
After that, install jdk9 using the following command:
Install JDK9 in Ubuntu:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer
Make it as default:
sudo apt-get install oracle-java9-set-default
Resource Link:
http://zakirrizvi.blogspot.com/2017/10/install-jdk9-in-ubuntu.html

Related

How To Configure and Download Java JDK in ubuntu for VS code

I've tried to run vscode in java but the vs code is showing an error of (Not Pointing To JDK).
Is there is any way to run java programs in vs code in ubuntu.
Install java from here Install java from here Install java from here Install java from here Install java from here
https://code.visualstudio.com/docs/java/java-debugging#:~:text=You%20can%20manually%20install%20the,Code%20for%20the%20first%20time.
The simplest way is to run:
sudo apt-get install openjdk- and to press TAB several times for available options.
You will then choose a specific jdk.
Some examples:
sudo apt-get install openjdk-14-jdk
sudo apt-get install openjdk-13-jdk
sudo apt-get install openjdk-11-jdk
Afterwards you can restart VSCode.

Ubuntu 18.04 Java Command Not Found Despite Being Installed

I initially had default-jdk and default-jre installed on Ubuntu 18.04.
Attempted to host a Minecraft Server for a friend, but was given the error found here
I followed the commentor's advice to reinstall java version 8 rather than version 11 installed above, by following this advice here that being
sudo rm -r /usr/lib/jvm/java-11-oracle
but as a mistake I had removed all files in that folder, leaving just the two directories
java-11-openjdk-amd64
java-8-openjdk-amd64
since then I have attempted to reinstall java using sudo apt-get install default-jdk ; sudo apt-get install default-jre and they install just fine, but running java -version, either as root or as user, returns:
Command 'java' not found, but can be installed with:
sudo apt install default-jre
sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-8-jre-headless
I have scoured askubuntu, digitalocean, and stackoverflow for some answers but I can't find anything that fixes this problem. I also asked my roommate, who is an experienced Computer Science major and who has used ubuntu extensively in the past, and he couldn't find a solution. Has anyone encountered this issue before?
I appreciate any and all responses 😊
Solution has been found. Running:
sudo apt purge -y openjdk-11-jre-headless
sudo apt purge -y openjdk-8-jre-headless
sudo apt purge -y default-jdk
and reinstalling has resolved the issue
Check your path. You should have remove the old jdk using apt-get. I think your system still assumes the old jdk-11 is still present. You could try to re-install it or use update-alternatives to switch to the other version.

When i am Trying to install JAVA 7 in Ubuntu 18.04 m facing some problem

Package oracle-java7-installer is not available, but is referred to by another package.
This may mean that the package is missing,that has been obsoleted, or
is only available from another source
oracle-java7-installeris no longer available from their ppa:webupd8team/java repository, and that would make sense now that Java 8 is out. Try installing Java 8 and see if the problem still persists.
As of March 22, 2019, it appears that oracle-java7-installer is no longer available from the ppa:webupd8team/java upstream repo (it could be that it got move to a different archive repo).
Alternatively, you can install oracle-java8-installer instead if you have the apt repo setup properly.
Previously its work with below steps-
Oracle JDK 6 and 7 are not available by default in Ubuntu 18.04/16.04 repositories and requires you to add repositories for the same as follows:
$ sudo add-apt-repository ppa:webupd8team/java (If you find upstream repo Update on this line and follw below steps)
$ sudo apt-get update
You may now run your command and enjoy using Java.
If you get error while installing ppa:repository, you will need to re-install ca certificates as follows:
$ sudo apt-get install --reinstall ca-certificates
Once this is done try running first two commands again.

Unable to install Android Studio in Ubuntu [duplicate]

This question already has answers here:
Error: Unable to run mksdcard SDK tool
(10 answers)
Closed 6 years ago.
I'm using Ubuntu Gnome 14.04, and I have Java 8 installed (both the JDK and the JRE).
When I was installing Android Studio everything worked, but a message appeared saying:
Unable to run mksdcard SDK tool
How can I install Android Studio correctly, or how do I fix this ?
Presuming that you are running the 64bit Ubuntu, the fix suggested for "Issue 82711" should solve your problem.
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Update:
For Ubuntu 15.10 & 16.04
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
#warsong is right. Installing only lib32stdc++6 solved the problem.
For next uses I rewrite #warsongs comment in answer area.
sudo apt-get install lib32stdc++6
Update :
For Ubuntu 15.04,15.10,16.04 LTS & Debian 8
For Fedora (tested for Fedora 23/24) run
dnf install compat-libstdc++-296 compat-libstdc++-33 glibc libgcc nss-softokn-freebl libstdc++ ncurses-libs zlib-devel.i686 ncurses-devel.i686 ant
I understand the question is regarding UBUNTU, but I had similar problem in Debian Jessie 64bit and warsongs suggestion worked for it also.
When I ran studio.sh android studio would start, but when I tried to configure the android SDK I got the error
Unable to run mksdcard SDK tool
WHen I tried
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Got error
E: Package 'lib32bz2-1.0' has no installation candidate
So took warsongs suggestion and only tried to install lib32stdc++6.
sudo apt-get install lib32stdc++6
After this was able to add the Android SDK into Android Studio.
Checkout this page
If you are running a 64-bit distribution on your development machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander) and above, install the libncurses5:i386, libstdc++6:i386, and zlib1g:i386 packages using apt-get:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
The Problem is caused by mksdcard not being installed correctly.
if you are running 64 bit, do this to fix the mksdcard problem.
sudo dpkg --add-architecture amd64
sudo apt-get update
sudo apt-get install libncurses5:amd64 libstdc++6:amd64 zlib1g:amd64
and 32 bit:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
In SDK 6.0, the error message is different but means the same thing.
Unable to run mksdcard
None of these options worked for me on Ubuntu 12.10 (yeah, I need to upgrade). However, I found an easy solution. Download the source from here: https://github.com/miracle2k/android-platform_sdk/blob/master/emulator/mksdcard/mksdcard.c. Then simply compile with "gcc mksdcard.c -o mksdcard". Backup mksdcard in the SDK tools subfolder and replace with the newly compiled one. Android Studio will now be happy with your SDK.
For Linux Mint run
sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6
If you run sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6
and got a message like: "The following packages have unmet dependencies: lib32stdc++6 : Depends: lib32gcc1 (>= 1:4.1.1)".
You can do something like this tut: https://askubuntu.com/questions/671791/lib32stdc6-package-depends-on-gcc-base-but-my-installed-version-is-newer
This issue arises when your 64 bit os tries to install the Android SDK which in turns tries to install some 32 bit binaries and thus is the issue of compatibility.
Open an additional terminal and type
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
would help to install all the required binaries. After this, start the afresh the Android SDK installation process.

Error While installing netbeans in ubuntu 12.04

I tried to install netbeans 'netbeans-7.2.1-ml-linux.sh' on my ubuntu12.04
But when i am executing this .sh file i am gettig the exception given below.
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
Can`t initialize UI
Running in headless mode
Exception: java.awt.HeadlessException thrown from the UncaughtExceptionHandler in thread "main"
You need to install Java Runtime Environment
sudo aptitude install default-jre
Refer to this answer:
netbeans installation error: can't initialize ui running in headless mode
Worked for me. For some reason, with OpenJDK the installer was unable to open a GUI.
The Problem is the support of openJDK for the UI.
The solution is installing Oracle JDK, open your terminal and write the following commands:
sudo apt-get remove openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java7-set-default
after that reinstall netbeans.
You're missing a X-Server for installation (java.awt.HeadlessException). The installation script needs a UI.
For some reason the sh installer does not work with the openJDK 7.
Quick fix to install is to change back to JDK 6.
run:
sudo update-alternatives --config java
(select java 6)
sh netbeans-7.2.1-ml-linux.sh
the installer should run and then just switch back to the java 7 JDK with update-alternatives.
In my case, I had openjdk installed, where /usr/bin/java was point to the installed openjdk.
I solved it by installing the Oracle JDK 7, from a tar.gz file. Extract the tar ball to a location say your $HOME directory.
After that
I modified the .bashrc file and modified the PATH variable to
PATH=$HOME/jdk1.7/bin/:$PATH export PATH
Remember the path to your jdk/bin should be appended to PATH, as as result the system will find the java executable in your path rather than picking the installed openjdk.
Note: I chose not to uninstall installed openjdk, as most of my Libreoffice and other installed applications were depending on it.
First you have to update
sudo apt-get update
Then default java
sudo apt-get install -f default-jre
sudo apt-get install -f default-jdk
And should be done.
This is what fixed it for me:
I installed the Java JDK. In this case:
sudo aptitude install openjdk-8-jdk
Here's the kicker: I made sure that my Home and Path variables were set properly. Again, in my case:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
export PATH=$PATH:/usr/lib/jvm/java-8-openjdk/bin
My initial issue was not having the JDK installed. It was then not having the environment variables properly set. If they aren't properly set, the installer won't launch. Simple as that.

Categories

Resources