In the past two days, I wanted to develop the android development environment in Linux, But I encountered a big problem when installing Sun's Java 6.
The source cannot be found.
The final installation method is to download the binfile of Java 6 on the official website, modify the/etc/profile file, and specify the location of Java, so that the Java command is available.
Then you need a command to specify which software the Java command is provided, that is, the default software. The reason for this setting is that you are afraid that your computer has installed several Java
For example, openjdk that comes with ubuntu (which is not installed by default), java5, and java6.
Update-alternatives -- config Java
This command is used to set the Java default software, similar to setting the default software in windows.
However, the following error occurs during execution.
Root @ jack-desktop: stream_src # Update-alternatives -- config javaupdate-Alternatives: Error: No Java candidate item.
The solution is as follows:
Root @ jack-desktop: /usr/bin # Update-alternatives -- install/usr/bin/Java/usr/local/share/JVM/jdk1.6.0 _ 45/bin/Java 1888 Update-alternatives: use/usr/local/share/JVM/jdk1.6.0 _ 45/bin/Java to provide/usr/bin/Java (Java) in automatic mode. Root @ jack-desktop:/usr/bin # Update-alternatives -- config Java link group Java contains only one candidate item: /usr/local/share/JVM/jdk1.6.0 _ 45/bin/Java requires no configuration. Root @ jack-desktop:/usr/bin # Java-versionjava version "1.6.0 _ 45" Java (TM) se Runtime Environment (build 1.6.0 _ 45-b06) Java hotspot (TM) client VM (build ipv45-b01, mixed mode, sharing)
OK!