I need openjdk to build my Android ROM, but I can't install it. I installed Oracle JDK but it doesn't work.
-
is it still suported ? from what have you tried to install it ? – Jeryosh Apr 21 '19 at 14:48
-
from standart repositories and ppa – вася пупкин Apr 21 '19 at 14:50
-
1This might help. – Vijay Apr 21 '19 at 14:54
-
@karel I don't think it's a duplicate. In the suggested duplicate Java version installed is Oracle's. OpenJDK 7 was in 14.04 which is now EOL. But here OP wants to install OpenJDK on 18.04. – Kulfy Apr 22 '19 at 15:39
-
@Vijay For some reason openjdk-r haven't ported JDK 7 for 18.04. вася пупкин: IMO you can't install OpenJDK7 on 18.04 due to dependency issues. – Kulfy Apr 22 '19 at 15:42
-
@Kulfy The last time openjdk-7-jdk was available from the default Ubuntu repositories was in 14.04. I'm not an advocate of trying to install openjdk-7-jdk from 14.04 in 18.04 because the problem of resolving package dependencies may be unsurmountable whereas Oracle JDK 7 installs clean as one bundle with no external Java dependencies. – karel Apr 22 '19 at 15:43
-
@karel Yeah I agree but IMO that post doesn't answers this question so can't be considered as a duplicate of that. – Kulfy Apr 22 '19 at 15:46
-
Just for the record book Google is adamant about insisting on JDK 8 for Android development these days, not JDK 7 or 11. openjdk-8-jdk is in the default Ubuntu 18.04 repositories. – karel Apr 22 '19 at 15:54
1 Answers
First install OpenJDK7:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo wget -P ~/Downloads http://ftp.de.debian.org/debian/pool/main/o/openjdk-7/openjdk-7-jdk_7u161-2.6.12-1_amd64.deb
sudo wget -P ~/Downloads http://ftp.de.debian.org/debian/pool/main/o/openjdk-7/openjdk-7-jre_7u161-2.6.12-1_amd64.deb
sudo wget -P ~/Downloads http://ftp.de.debian.org/debian/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u161-2.6.12-1_amd64.deb
sudo wget -P ~/Downloads http://ftp.de.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.2-2+b1_amd64.deb
sudo update-alternatives --config java
cd ~/Downloads
sudo dpkg -i *.deb
sudo apt install -f
#choose Java7
sudo update-alternatives --config java
Now install Maven:
sudo apt-get install maven
Install Eclipse Luna 4.4.2 SR2
sudo su
cd /opt
sudo wget -P ~/Downloads http://download.eclipse.org/technology/epp/downloads/release/luna/SR2/eclipse-jee-luna-SR2-linux-gtk.tar.gz
tar -xvf eclipse*.tar.gz
Now edit the eclipse.ini
file:
sudo nano /opt/eclipse/eclipse.ini <br/>
and change:
If you run in Performance Issues, find for your self the best XMS/XMX Range
Texteditor start
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=4096m
-Xms2048m
-Xmx4096m
#Texteditor end
Now run eclipse:
cd /usr/local/bin
echo 'ECLIPSE=/opt/eclipse/eclipse' >eclipse
echo 'exec $ECLIPSE "$@"' >>eclipse
chmod +x eclipse
exit
eclipse
Add eclipse to the Desktop:
sudo nano /opt/eclipse/eclipse.desktop
and add:
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=/opt/eclipse/icon.xpm
Exec=/opt/eclipse/eclipse
Terminal=false
Categories=Development
StartupWMClass=Eclipse
Save and exit and execute:
sudo chmod +x /opt/eclipse/eclipse.desktop
sudo cp /opt/eclipse/eclipse.desktop ~/Schreibtisch
sudo mkdir ~/.local/share/applications
sudo cp /opt/eclipse/eclipse.desktop ~/.local/share/applications
Wilffly 8.2.1 sudo su sudo wget -P /opt https://download.jboss.org/wildfly/8.2.1.Final/wildfly-8.2.1.Final.tar.gz cd /opt tar -xvzf wildfly*.tar.gz sudo mv wildfly-8.2.1.Final wildfly Add Management-User sudo /opt/wildfly/bin/add-user.sh
sudo nano /opt/wildfly/standalone/configuration/mgmt-users.properties
Wildfly Verknüpfungen erstellen sudo wget -P /opt/wildfly/bin https://api.jujucharms.com/v5/precise/wildfly-5/icon.svg sudo nano /opt/wildfly/bin/wildflyapplicationserver.desktop
[Desktop Entry] Type=Application Name=Wildfly Standalone 8.2.1 Comment=Wildfly Application Server authored by JBoss Icon=/opt/wildfly/bin/icon.svg Exec=/opt/wildfly/bin/standalone.sh Terminal=true Categories=Development StartupWMClass=Wildfly
sudo chmod +x /opt/wildfly/bin/wildflyapplicationserver.desktop sudo cp /opt/wildfly/bin/wildflyapplicationserver.desktop ~/Schreibtisch sudo cp /opt/wildfly/bin/wildflyapplicationserver.desktop ~/.local/share/applications
-
2Welcome to [ubuntu.se]! ;-) Could you please review my edits and also review the editing help to improve the readability of your answers in the future... ;-) Also please leave a link at the bottom of your answer for any source material you've used unless you are m.zenkert – Fabby May 15 '19 at 11:23
-
2
-
1As OP asks to install OpenJDK 7, why should they also install Maven and Eclipse, change configuration files and add a
.desktop
file? In which way are these parts of your answer relevant to the question? – dessert May 15 '19 at 11:32 -
The PPA you suggest for installing OpenJDK 7 is out of date and missing important security patches (see here) – I think a warning would be appropriate. – dessert May 15 '19 at 11:36
-
What is the point of adding the PPA when you are trying to install JDK using deb packages? Also, this PPA haven't ported JDK7 for some reasons regarding which I've already left comment on the question. Have you tried this on 18.04? Were you able top solve all dependency issues? – Kulfy May 15 '19 at 11:43
-
i know all this things.... ...missing security level and patches, but there are many developers out there, who still need to use java 7 – NoobMaster69 May 15 '19 at 12:02
-
-
And thx for editing :) your welcome for that :) The reason for the instructions for the installation of Maven and Eclipse, I just assume that it is needed ... just as a SVN or GIT or JBOSS Wildfly in compatible versions to Java7. So I will just offer the complete solution. :)
The real reason for the complete solution is that right now I need exactly that for our company and have the solution at hand, otherwise a complete rebuild will be necessary.
– NoobMaster69 May 15 '19 at 12:11 -
-
-
-
Please review the editing help to improve the readability of your answers... It's a mess again. -1 – Fabby May 15 '19 at 14:17
-
It seems you are adding irrelevant details to the answer. Do you really think this question need Wilffly, Eclipse, etc? – Kulfy May 15 '19 at 16:16