Hot answers tagged

138

Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ): dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove sudo apt-get -y autoremove Purge config files: dpkg -l | grep ...


132

There are several implementations of Java. The three most common implementations when talking about it for Ubuntu are: OpenJDK: The primary goal of the OpenJDK project is to produce an open-source implementation of the Java SE Platform (6 and 7). This is the default version of Java that Ubuntu uses and is the easiest to install. Sun Java: Sun Java is the ...


84

You can do this for; Final Update JDK sudo apt-get install openjdk-8-jdk JRE sudo apt-get install openjdk-8-jre Old Update I found two repository but I do not recommend OpenJDK builds (all archs) ppa:openjdk-r/ppa OpenJDK 8 backport for trusty ppa:jochenkemnade/openjdk-8 Original Message If you really want to use OpenJDK, you have to ...


81

Switching between installed Java versions can be accomplished using the update alternatives command. To get a list of your installed Java platforms, run the following command from the terminal: sudo update-alternatives --config java This will give you a list output similar to this: There are 2 choices for the alternative java (providing /usr/bin/java). ...


54

Alternate install Java for Chrome, can also install icedtea: sudo apt-get install icedtea-7-plugin Then link icedtea in to chromium plugin folder thusly cd /usr/lib/chromium-browser/plugins and link sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so


52

If you are using Debian Jessie (or Ubuntu 13.10+), try sudo apt-get install lib32stdc++6


52

Installing OpenJDK is not enough for enabling Java in browsers. You'll also need to install the icedtea-7-plugin package: A restart of the browser might be required.


49

Installing JDK To install JDK, you can refer to help.ubuntu.com/community/Java. If you want to install openJDK, sudo apt-get install openjdk-7-jdk If you want to install Oracle JDK, you can use PPA from webup8 team. sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer Installing IntelliJ IDEA ...


45

This problem is occurring because the Android SDK is compiled for a 32-bit GNU/Linux system, and your Ubuntu system is a 64-bit GNU/Linux system. The solution should be easy (since Ubuntu fully supports running 32-bit programs on a 64-bit OS)--just install the 32-bit versions of the libraries it needs. The simplest and easiest way to do this is to install ...


40

The simplest way is: update-java-alternatives -l - Shows you all the Java versions you have installed. java -showversion - Shows you the java version you are using and help. java -version - Java Version only Normally it would be OpenJDK.


39

This guide (Which took me a little over 3 days to write and test) was made to solve most problems regarding the correct installation of Minecraft. It is very thorough and oriented for Ubuntu 11.10+ since this was the first version to include OpenJDK 1.7, but it might still be missing more information to solve more problems regarding Minecraft. I also did ...


39

OpenJDK 8 was released in March 2014. As of the time of this question, there are no OpenJDK 8 packages in the official Ubuntu repositories for any Ubuntu release. They "will be available soon", as the JDK 8 project page says, for some definition of soon. First, the OpenJDK 8 packages will land in the Ubuntu development release. This may happen during the ...


39

You can completely remove the OpenJDK and fresh Install Oracle Java JDK by the following steps: Remove OpenJDK completely by this command: sudo apt-get purge openjdk-\* Download the Oracle Java JDK here. Note: download appropriate file, for example if your system is x64 Ubuntu (i.e, Debian) the download file is named like this: ...


32

This thread was the fix for me. Specifically, installing this package: sudo apt-get install lib32z1 lib32z1-dev


27

There are currently two Java versions (vendors, if you will) available: Oracle's (previously Sun) JDK, the closed source Java, with commercial support from Oracle 'n stuffs. OpenJDK, the open source Java. Oracle released part of their source and renamed it. In the days of Java 6, there used to be a big difference between the two of them, OpenJDK ...


27

sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk sudo update-alternatives --config java sudo update-alternatives --config javac


26

This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac): file /etc/alternatives/java /etc/alternatives/javac This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run: file `which java ...


26

The problem is that the default-jre package depends on OpenJDK 6 and most other packages have their dependencies defined as default-jre | openjdk-6-jre | sun-java6-jre - so until OpenJDK 7 becomes officially supported and will be used as the default version, or until all Java-dependent packages update their dependencies, you'll have to keep OpenJDK 6 around ...


24

To completely remove OpenJDK on Ubuntu 11.10 (this may or may not be sufficient on other versions of Ubuntu), run: sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* If you want instructions for removing the proprietary Oracle ("Sun") version of Java, then you'll have to specify how you installed it. (If you edit your question to indicate this and leave ...


24

Great question, I was wondering this myself. I found that you can use the following to remove the openjdk-7-jre on Ubuntu 13.04: sudo apt-get autoremove openjdk-7-jre Press 'y' and then press enter when prompted to confirm this change. This should also clean up all the additional dependency libraries that were installed with it. I also found you can use ...


22

Note – This will only work with 14.10 or later: 1 year late, but as today it works as expected with apt-get: $ sudo apt-get install openjdk-8-jdk Or: $ sudo apt-get install openjdk-8-jre How to set the default JDK Fastest way Run $ sudo update-alternatives --config java and enter the number for which JDK to use of your choice. Second way ...


17

Sun Java has been disabled via a security update due to it exposing users to known security holes and has been removed from the partner archive. Due to the severity of the security risk, Canonical is immediately releasing a security update for the Sun JDK browser plugin which will disable the plugin on all machines. This will mitigate users' risk from ...


17

For installing Oracle Java 7: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo mkdir -p /usr/lib/mozilla/plugins #just in case, this will be added to the package in the next version sudo apt-get install oracle-jdk7-installer Are "PPA's" safe to add to my system, and what are some "red flags" to watch out for? ...


17

I had exactly the same problem today. First, a little googling brought me to your issue (didn't assumed to be due to OpenJDK). After a little more research, finally solved this strange behaviour: have a look at this ubuntu-bug. So the quick solution is just to run sudo apt-get --reinstall install tzdata-java (reinstalling Time zone and daylight-saving time ...


16

Feel free to use this as a reference to tinkering with Java at runtime. Choosing your JRE To choose your JRE, use sudo update-alternatives --config java This will give something like the following output. Selection Path Priority Status ------------------------------------------------------------ 0 ...


15

I just ran into this on Ubuntu 14.04 64-bit. My solution was: sudo apt-get install -y libc6:i386 libgcc1:i386 libstdc++6:i386 libz1:i386 Based on the shared libraries required for the aapt tool: $ readelf -d android-sdk-linux/build-tools/20.0.0/aapt | grep -i shared 0x00000001 (NEEDED) Shared library: [librt.so.1] 0x00000001 ...


15

Actually, a better answer is to enter the following at the command prompt. sudo update-ca-certificates -f


14

This should get you started: #!/bin/sh add-apt-repository ppa:webupd8team/java && apt-get update && apt-get install oracle-java7-installer && echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections && update-java-alternatives -s java-7-oracle && wget -O ...


14

You may not need to completely remove the OpenJDK to resolve your problem. Install the sun-java6 packages. Then use update-java-alternatives to switch to the Sun java packages. If you do want to completely remove OpenJDK remove the default-jdk and/or default-jre packages. You may need to remove some java packages but most of them should be happy once ...


13

Installing OpenJDK - Recommended The simplest way to install Java on Ubuntu is to use OpenJDK. This will work fine for most people. To install it, click on the small button with the Ubuntu logo on it, as shown in the screenshot below. After opening the Dash Home, you need to type in Terminal. Click on the icon that is circled in the screenshot below. ...



Only top voted, non community-wiki answers of a minimum length are eligible