HowTo Install Java on CentOS 4 and CentOS 5
http://writeblog.csdn.net/PostEdit.aspx?entryId=5305099
Contents
Preliminary material
Method One: A simple approach
Method Two: A less simple approach
Java for the desktop user
Java for the developer and the server environment
Requirements
Step 1. Initial setup
Step 2. Installing your favorite JDK
A. Sun JDK 1.4.2
B. IBM JDK 1.4.2
C. Sun JDK 1.5
D. IBM JDK 1.5
E. Sun JDK 1.6
Step 3. Install the JPackage repository (CentOS 4 only - this step is optional, not finished)
Other Tools
Administrivia
1. Preliminary material
The Sun
license concerning distribution of Java (through to Java 6) contains
clauses, the terms of which, the CentOS team have concluded they cannot
meet. Conversations with Sun's representatives on a modified
distribution license were underway in August 2008 but they did not
yield fruit. Seemingly Sun was looking forward to the more free, later,
Java releases (on the horizon, upstream) in our upstream's Fedora
project.
SPECIAL NOTE: Starting with CentOS 5.3 the upstream source for SRPMs, which the project rebuilds into the base
and updates
repositories, has added the openjdk
product into the freely available sources as part of its distribution.
As such, the CentOS project can now ship an integrated Java
implementation. Using this approach can greatly simplify installation
matters and we encourage you to consider using the proper subset from
the following newly provided packages & filing bugs upstream, if
problems are noted.
[user@host ~]$ sudo yum list \*java-1\* | grep open
java-1.6.0-openjdk.x86_64 1:1.6.0.0-0.25.b09.el5 base
java-1.6.0-openjdk-demo.x86_64 1:1.6.0.0-0.25.b09.el5 base
java-1.6.0-openjdk-devel.x86_64 1:1.6.0.0-0.25.b09.el5 base
java-1.6.0-openjdk-javadoc.x86_64 1:1.6.0.0-0.25.b09.el5 base
java-1.6.0-openjdk-src.x86_64 1:1.6.0.0-0.25.b09.el5 base
[user@host ~]$
Additionally, some fonts are req
相关文档:
“JDK1.5”的一个重要主题就是通过新增一些特性来简化开发,这些特性包括泛型,for-each 循环,自动装包/拆包,枚举,可变参数, 静态导入 。使用这些特性有助于我们编写更加清晰,精悍,安全的代码。
一. 首先简单介绍一下各种特性及其使用
1.泛型(Generic)
C++通过模板技术可以指定集合的元素类型,而J ......
今日在网上偶然碰到一个初学者的java题目,就尝试的做了一下,但没想到一做就是接近一个钟头啊,看来java学习的路上还是路漫漫兮修远啊。
题目如下:
编写一个Java Application 程序,接受用户输入的一个浮点数,将其的整数部分和小数部分分别输出。
如:输入56.6 ,则有
整数部分:56
......
Java时间设为二十四小时制和十二小时制的区别:
1) 二十四小时制: “yyyy-MM-dd HH:mm:ss”
2)十二小时制: “"yyyy-MM-dd hh:mm:ss"”
例(二十四小时制):
private String getTime(){
Calendar now;
SimpleDateFormat fmt;
now = Calendar.getInstance();
fmt = new S ......