我需要 openjdk 来构建我的 Android ROM,但我无法安装它。我安装了 Oracle JDK,但它不起作用。
答案1
首先安装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
现在安装 Maven:
sudo apt-get install maven
安装 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
现在编辑eclipse.ini
文件:
sudo nano /opt/eclipse/eclipse.ini <br/>
并改变:
如果你遇到性能问题,请为自己找到最佳的 XMS/XMX 范围
文本编辑器启动
-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
现在运行 eclipse:
cd /usr/local/bin
echo 'ECLIPSE=/opt/eclipse/eclipse' >eclipse
echo 'exec $ECLIPSE "$@"' >>eclipse
chmod +x eclipse
exit
eclipse
将 eclipse 添加至桌面:
sudo nano /opt/eclipse/eclipse.desktop
并添加:
[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
保存退出并执行:
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 /opthttps://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 添加管理用户 sudo /opt/wildfly/bin/add-user.sh
sudo nano /opt/wildfly/standalone/configuration/mgmt-users.properties
创建 Wildfly 调用 sudo wget -P /opt/wildfly/binhttps://api.jujucharms.com/v5/precise/wildfly-5/icon.svg sudo nano /opt/wildfly/bin/wildflyapplicationserver.desktop
[桌面条目] 类型=应用程序名称=Wildfly Standalone 8.2.1 注释=由 JBoss 编写的 Wildfly 应用服务器图标=/opt/wildfly/bin/icon.svg Exec=/opt/wildfly/bin/standalone.sh 终端=true 类别=开发 StartupWMClass=Wildfly
sudo chmod +x /opt/wildfly/bin/wildflyapplicationserver.desktop sudo cp /opt/wildfly/bin/wildflyapplicationserver.desktop ~/书写笔记 sudo cp /opt/wildfly/bin/wildflyapplicationserver.desktop ~/.local/share/applications