Ask Your Question

How can I install OpenJDK 7

asked 2015-05-29 20:40:07 -0500

rosenpin gravatar image

I'm trying to build android from source and I need OpenJDK 7 .

How the hell can I install it?

I looked all over

edit retag flag offensive close merge delete


for check the version of java type

java -version
christianbueno gravatar imagechristianbueno ( 2017-10-15 17:32:07 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-29 20:57:20 -0500

florian gravatar image

updated 2015-05-29 21:13:23 -0500

Can you live with OpenJDK 8?

If so, run sudo dnf search openjdk to get an overview of all OpenJDK packages available in F22. Then select what you need: start with sudo dnf install java-1.8.0-openjdk java-1.8.0-openjdk-devel.

If you want openjdk 7.0 go here, download the correspondig .rpm's ( java-1.7.0-openjdk and java-1.7.0-openjdk-devel) for your architecture, and install them locally using dnf.

edit flag offensive delete link more


Is there a way to have java-1.8.0-openjdk and java-1.7.0-openjdk installed in paralell? I would like to keep 1.8 installed and updated for regular system operation, but compiling Android strictly requires OpenJDK 1.7. When I try to install them alongside, I get the following errors:

Error: installed package java-1.8.0-openjdk-1: obsoletes java-1.7.0-openjdk provided by java-1.7.0-openjdk-1:
fat-lobyte gravatar imagefat-lobyte ( 2015-05-30 05:31:11 -0500 )edit

answered 2015-07-22 04:00:04 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

For building Android, your best bet is to just install the Oracle JDK 7. I downloaded jdk-7u80-linux-x64.tar.gz and put in /opt/oracle/java/.

Then you can just edit build/core/ and force for all cases

requires_openjdk := false

Note that even if you get OpenJDK 1.7 installed on Fedora it returns 'java -version' differently than Ubuntu and you'll have to change the build/core/ check for the version to look for "openjdk" instead of "java" at the beginning of the version.

Using the Oracle JDK is fine, though. It is used for all host types that are not Linux.

edit flag offensive delete link more

Question Tools


Asked: 2015-05-29 20:40:07 -0500

Seen: 8,793 times

Last updated: May 29 '15