Ubuntu 10.04 LTS 安装sun-java6-jdk ,出现错误。
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
说是Ubuntu 10.04已经去掉sun-java6-jdk 和sun-java6-jre的软件包
sudo add-apt-repository "deb lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
错误提示还是一样:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
这些都干过了。也查了源列表。。也有 lucid partner,并且有了好几个。
求解。。。。
自己回答:
在更新apt源头sudo apt-get update时出现如下提示:
Ign oneiric/main Translation-en_US
Ign lucid/partner Translation-en_US
Ign lucid/partner Translation-en
Ign oneiric/main Translation-en
Ign jaunty/multiverse TranslationIndex
Ign jaunty-updates/multiverse TranslationIndex
Ign natty/partner Translation-en_US
Ign natty/partner Translation-en
Hit oneiric/main Translation-en
Hit oneiric/multiverse Translation-en
Hit oneiric/restricted Translation-en
Hit oneiric/universe Translation-en
Hit oneiric-updates/main Translation-en
Hit oneiric-updates/multiverse Translation-en
Hit oneiric-updates/restricted Translation-en
Hit oneiric-updates/universe Translation-en
Hit oneiric-backports/main Translation-en
Hit oneiric-backports/multiverse Translation-en
Hit oneiric-backports/restricted Translation-en
Hit oneiric-backports/universe Translation-en
Err jaunty/multiverse Sources
404 Not Found [IP: 91.189.92.180 80]
Err jaunty/multiverse amd64 Packages
404 Not Found [IP: 91.189.92.180 80]
Err jaunty/multiverse i386 Packages
404 Not Found [IP: 91.189.92.180 80]
Err jaunty-updates/multiverse Sources
404 Not Found [IP: 91.189.92.180 80]
Err jaunty-updates/multiverse amd64 Packages
404 Not Found [IP: 91.189.92.180 80]
Err jaunty-updates/multiverse i386 Packages
404 Not Found [IP: 91.189.92.180 80]
Ign jaunty/multiverse Translation-en_US
Ign jaunty/multiverse Translation-en
Ign jaunty-updates/multiverse Translation-en_US
Ign jaunty-updates/multiverse Translation-en
W: Failed to fetch /ubuntu/dists/jaunty/multiverse/source/Sources 404 Not Found [IP: 91.189.92.180 80]
W: Failed to fetch /ubuntu/dists/jaunty/multiverse/binary-amd64/Packages 404 Not Found [IP: 91.189.92.180 80]
W: Failed to fetch /ubuntu/dists/jaunty/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.92.180 80]
W: Failed to fetch /ubuntu/dists/jaunty-updates/multiverse/source/Sources 404 Not Found [IP: 91.189.92.180 80]
W: Failed to fetch /ubuntu/dists/jaunty-updates/multiverse/binary-amd64/Packages 404 Not Found [IP: 91.189.92.180 80]
W: Failed to fetch /ubuntu/dists/jaunty-updates/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.92.180 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
但是。。。
cc@ubuntu:~$ sudo apt-get install sun-java6-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
???
然后去学习一下的是什么东西··
JDK
JDK 是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK.最主流的JDK是Sun公司发布的JDK,除了Sun之外,还有很多公司和组织都开发了自己的JDK,例如IBM公司开发的JDK,BEA公司的Jrocket,还有GNU组织开发的JDK等等。其中IBM的JDK包含的JVM(Java Virtual Machine)运行效率要比Sun JDK包含的JVM高出许多。而专门运行在x86平台的Jrocket在服务端运行效率也要比Sun JDK好很多。但不管怎么说,我们还是需要先把Sun JDK掌握好。
JDK一般有三种版本:SE(J2SE),standard edition,标准版,是我们通常用的一个版本EE(J2EE),enterpsise edtion,企业版,使用这种JDK开发J2EE应用程序,ME(J2ME),micro edtion,主要用于移动设备、嵌入式设备上的java应用程序Java开发工具(JDK)是许多Java专家最初使用的开发环境。尽管许多编程人员已经使用第三方的开发工具,但JDK仍被当作Java开发的重要工具。JDK由一个标准类库和一组建立,测试及建立文档的Java实用程序组成。其核心Java API是一些预定义的类库,开发人员需要用这些类来访问Java语言的功能。Java API包括一些重要的语言结构以及基本图形,网络和文件I/O.一般来说,Java API的非I/O部分对于运行Java的所有平台是相同的,而I/O部分则仅在通用Java环境中实现。
作为JDK实用程序,工具库中有七种主要程序。
◆Javac:Java编译器,将Java源代码转换成字节码。
◆Java:Java解释器,直接从类文件执行Java应用程序字节代码。
◆appletviewer:小程序浏览器,一种执行HTML文件上的Java小程序的Java浏览器。
◆Javadoc:根据Java及说明语句生成HTML文档。
◆Jdb:Java调试器,可以逐行执行程序,设置断点和检查变量。
◆Javah:产生可以调用Java过程的C过程,或建立能被Java程序调用的C过程的头文件。
◆Javap:Java反汇编器,显示编译类文件中的可访问功能和数据,同时显示字节代码含义。
JRE
JRE(Java Runtime Environment,Java运行环境),运行JAVA程序所必须的环境的集合,包含JVM标准实现及Java核心类库。是Sun的产品,包括两部分:JavaRuntimeEnvironment和JavaPlug-inJavaRuntimeEnvironment(JRE)是可以在其上运行、测试和传输应用程序的Java平台。它包括Java虚拟机、Java平台核心类和支持文件。它不包含开发工具——编译器、调试器和其它工具。JRE需要辅助软件 ——JavaPlug-in——以便在中运行applet.J2RE是Java2 Runtime Environment,即Java运行环境,有时简称JRE.如果你只需要运行Java程序或Applet,下载并安装它即可。如果你要自行开发Java软件,请下载JDK.在JDK中附带有JRE.注意由于Microsoft对Java的支持不完全,请不要使用IE自带的来运行Applet,务必安装一个JRE或JDK.
最后实现办法
1、添加这个源:
deb /ubuntu/ hardy multiverse。
2、sudo apt-get update
3、sudo apt-get install sun-java6-jdk
阅读(1499) | 评论(0) | 转发(1) |