其实用Red Hat Enterprise Linux搭建Java开发环境也并不困难,在下列出几个步骤,供参考:
1、挂载光盘
[root@station25 ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected, mounting read-only
2、配置yum源,并验证[rhel-debuginfo]
name=Red Hat
baseurl=file:///media/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
[root@station25 ~]# yum update Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. rhel-debuginfo | 1.3 kB 00:00 rhel-debuginfo/primary | 732 kB 00:00 rhel-debuginfo 2292/2292 Skipping security plugin, no data Setting up Update Process No Packages marked for Update
其实也主要就是这几个东西(当然还有一些依赖包啥的,总共133M)
java-1.6.0-openjdk.i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo
java-1.6.0-openjdk-demo.i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo
java-1.6.0-openjdk-devel.i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo
java-1.6.0-openjdk-javadoc.i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo
java-1.6.0-openjdk-src.i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo
然后安装[root@station25 ~]# yum install java-* -y
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package java-1.4.2-gcj-compat-devel.i386 0:1.4.2.0-40jpp.115 set to be updated
rhel-debuginfo/filelists | 2.3 MB 00:00
--> Processing Dependency: libgcj-devel >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-devel
--> Processing Dependency: gcc-java >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-devel
--> Processing Dependency: libgcj-devel >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-devel
--> Processing Dependency: gcc-java >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-devel
--> Processing Dependency: eclipse-ecj for package: java-1.4.2-gcj-compat-devel
--> Processing Dependency: /usr/lib/gcc/i386-redhat-linux/4.1.1/libgcj.spec for package: java-1.4.2-gcj-compat-devel
--> Processing Dependency: /usr/lib/gcc/i386-redhat-linux/4.1.1/libgcj.spec for package: java-1.4.2-gcj-compat-devel
---> Package java-1.4.2-gcj-compat-javadoc.i386 0:1.4.2.0-40jpp.115 set to be updated
---> Package java-1.4.2-gcj-compat-src.i386 0:1.4.2.0-40jpp.115 set to be updated
--> Processing Dependency: libgcj-src >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-src
--> Processing Dependency: libgcj-src >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-src
---> Package java-1.6.0-openjdk.i386 1:1.6.0.0-1.2.b09.el5 set to be updated
---> Package java-1.6.0-openjdk-demo.i386 1:1.6.0.0-1.2.b09.el5 set to be updated
---> Package java-1.6.0-openjdk-devel.i386 1:1.6.0.0-1.2.b09.el5 set to be updated
---> Package java-1.6.0-openjdk-javadoc.i386 1:1.6.0.0-1.2.b09.el5 set to be updated
---> Package java-1.6.0-openjdk-src.i386 1:1.6.0.0-1.2.b09.el5 set to be updated
--> Running transaction check
---> Package eclipse-ecj.i386 1:3.2.1-19.el5 set to be updated
---> Package gcc-java.i386 0:4.1.2-46.el5 set to be updated
---> Package libgcj-devel.i386 0:4.1.2-46.el5 set to be updated
---> Package libgcj-src.i386 0:4.1.2-46.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================
Package Arch Version Repository Size
================================================================================================================
Installing:
java-1.4.2-gcj-compat-devel i386 1.4.2.0-40jpp.115 rhel-debuginfo 50 k
java-1.4.2-gcj-compat-javadoc i386 1.4.2.0-40jpp.115 rhel-debuginfo 24 M
java-1.4.2-gcj-compat-src i386 1.4.2.0-40jpp.115 rhel-debuginfo 19 k
java-1.6.0-openjdk i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo 28 M
java-1.6.0-openjdk-demo i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo 2.2 M
java-1.6.0-openjdk-devel i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo 9.2 M
java-1.6.0-openjdk-javadoc i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo 20 M
java-1.6.0-openjdk-src i386 1:1.6.0.0-1.2.b09.el5 rhel-debuginfo 25 M
Installing for dependencies:
eclipse-ecj i386 1:3.2.1-19.el5 rhel-debuginfo 7.9 M
gcc-java i386 4.1.2-46.el5 rhel-debuginfo 2.9 M
libgcj-devel i386 4.1.2-46.el5 rhel-debuginfo 1.4 M
libgcj-src i386 4.1.2-46.el5 rhel-debuginfo 11 M
Transaction Summary
================================================================================================================
Install 12 Package(s)
Update 0 Package(s)
Remove 0 Package(s)