[root@jmnote ~]# yum list java*jdk-devel
Loaded plugins: fastestmirror
Loading mirr
Available Packages
java-1.6.0-openjdk-devel.x86_64 1:1.6.0.0-1.30.1.11.5.el5 Daum
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.3.el5.1 Daum
[root@jmnote ~]# yum install java-1.7.0-openjdk-devel
... (생략)
==================================================================================================================
Package Arch Version Repository Size
==================================================================================================================
Installing:
java-1.7.0-openjdk-devel x86_64 1:1.7.0.9-2.3.4.1.el6_3 updates 9.4 M
Installing for dependencies:
giflib x86_64 4.1.6-3.1.el6 base 37 k
java-1.7.0-openjdk x86_64 1:1.7.0.9-2.3.4.1.el6_3 updates 26 M
jline noarch 0.9.94-0.8.el6 base 86 k
jpackage-utils noarch 1.7.5-3.12.el6 base 59 k
rhino noarch 1.7-0.7.r2.2.el6 base 778 k
tzdata-java noarch 2012j-1.el6 updates 155 k
Transaction Summary
==================================================================================================================
Install 7 Package(s)
Total download size: 36 M
Installed size: 126 M
Is this ok [y/N]:
... (생략)
Installed:
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.4.1.el6_3
Dependency Installed:
giflib.x86_64 0:4.1.6-3.1.el6 java-1.7.0-openjdk.x86_64 1:1.7.0.9-2.3.4.1.el6_3
jline.noarch 0:0.9.94-0.8.el6 jpackage-utils.noarch 0:1.7.5-3.12.el6
rhino.noarch 0:1.7-0.7.r2.2.el6 tzdata-java.noarch 0:2012j-1.el6
Complete!
[root@jmnote ~]# rpm -qa java*jdk-devel
java-1.7.0-openjdk-devel-1.7.0.9-2.3.4.1.el6_3.x86_64
[root@jmnote ~]# javac -version
javac 1.7.0_09
echo "public class HelloWorld {" > HelloWorld.java
echo " public static void main(String[] args) {" >> HelloWorld.java
echo " System.out.println(\"Hello, World\");" >> HelloWorld.java
echo " }" >> HelloWorld.java
echo "}" >> HelloWorld.java
javac HelloWorld.java
java HelloWorld
rm -f HelloWorld.java HelloWorld.class
[root@jmnote ~]# echo "public class HelloWorld {" > HelloWorld.java
[root@jmnote ~]# echo " public static void main(String[] args) {" >> HelloWorld.java
[root@jmnote ~]# echo " System.out.println(\"Hello, World\");" >> HelloWorld.java
[root@jmnote ~]# echo " }" >> HelloWorld.java
[root@jmnote ~]# echo "}" >> HelloWorld.java
[root@jmnote ~]# javac HelloWorld.java
[root@jmnote ~]# java HelloWorld
Hello, World
[root@jmnote ~]# rm -f HelloWorld.java HelloWorld.class