我安装了 Oracle/Sun JDK 7 并设置了替代方案。当我尝试安装 Arduino IDE 时,它说
$ sudo apt-get install arduino
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
ax25-node libax25 openbsd-inetd
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
ca-certificates-java default-jre default-jre-headless extra-xdg-menus icedtea-7-jre-jamvm java-common libatk-wrapper-java libatk-wrapper-java-jni libjna-java
openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib ttf-dejavu-extra tzdata-java
Suggested packages:
equivs libjna-java-doc icedtea-7-plugin sun-java6-fonts fonts-ipafont-gothic fonts-ipafont-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts
The following NEW packages will be installed:
arduino ca-certificates-java default-jre default-jre-headless extra-xdg-menus icedtea-7-jre-jamvm java-common libatk-wrapper-java libatk-wrapper-java-jni libjna-java
openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib ttf-dejavu-extra tzdata-java
0 upgraded, 15 newly installed, 0 to remove and 61 not upgraded.
Need to get 45.4 MB of archives.
After this operation, 68.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
我不知道如何解决这个问题。我不想安装另一个 JDK/JRE。任何帮助都非常感谢。
答案1
arduino 软件包依赖于 default-jre,而 default-jre 又依赖于 opedjdk-7-jre:
apt-cache depends arduino default-jre
arduino
|Depends: default-jre
Depends: <java6-runtime>
openjdk-6-jre
default-jre
openjdk-7-jre
Depends: libjna-java
Depends: librxtx-java
Depends: arduino-core
Recommends: extra-xdg-menus
Recommends: policykit-1
default-jre
Depends: default-jre-headless
Depends: openjdk-7-jre
因此,你注定要使用 openjdk。
答案2
所以很简单..首先删除现有的java
软件包,然后删除clean
系统,然后尝试再次安装..
以下步骤将解决您的问题,按顺序运行:
删除 java 和所有依赖包。
sudo apt-get autoremove sudo apt-get autoclean sudo apt-get --purge remove openjdk-7* sudo apt-get autoremove openjdk-7* sudo apt-get autoclean sudo apt-get autoremove sudo apt-get update sudo apt-get -f install
然后最后安装
arduino
sudo apt-get install arduino
如果出现问题,请回复..