Hi all

I read information from here:
HowTos/JavaOnCentOS - CentOS Wiki and step by step to do it as:

[root@ativn ~]# mkdir rpmbuild

[root@ativn ~]# mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}

[root@ativn ~]# yum install -y rpm-build gcc gcc-c++ redhat-rpm-config
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
Excluding Packages in global exclude list
Finished
Setting up Install Process
Parsing package install arguments
Package rpm-build-4.4.2.3-9.el5.i386 already installed and latest version
Package gcc-4.1.2-44.el5.i386 already installed and latest version
Package gcc-c++-4.1.2-44.el5.i386 already installed and latest version
Package redhat-rpm-config-8.0.45-29.el5.noarch already installed and latest version
Nothing to do

(I installed in already, so that it is OK)

[root@ativn ~]# cd rpmbuild

[root@ativn rpmbuild]# curl -L -O http://mirrors.dotsrc.org/jpackage/1...1jpp.nosrc.rpm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17806 100 17806 0 0 16408 0 0:00:01 0:00:01 --:--:-- 35626
[root@ativn rpmbuild]# cd SOURCES

[root@ativn SOURCES]# curl -L -O 'http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-1_5_0_15-linux-i586.bin?BundledLineItemUUID=MONIBe.l3ugAAAEg5jQVh GHa&OrderID=wzJIBe.lqQsAAAEgzjQVhGHa&ProductID=yL7 ACUFBjqYAAAEYees5AXuQ&FileName=/jdk-1_5_0_15-linux-i586.bin'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 47.3M 100 47.3M 0 0 1716k 0 0:00:28 0:00:28 --:--:-- 4229k

[root@ativn SOURCES]# cd ..

[root@ativn rpmbuild]# chmod +x SOURCES/jdk-1_5_0_15-linux-i586.bin

[root@ativn rpmbuild]# rpmbuild --rebuild java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpmInstalling java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpm

warning: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID c431416d
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.71331
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /usr/src/redhat/BUILD/jdk1.5.0_15
+ export MORE=10000
+ MORE=10000
+ sh /usr/src/redhat/SOURCES/jdk-1_5_0_15-linux-i586.bin
sh: /usr/src/redhat/SOURCES/jdk-1_5_0_15-linux-i586.bin: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.71331 (%prep)


RPM build errors:
InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID c431416d
Bad exit status from /var/tmp/rpm-tmp.71331 (%prep)
[root@ativn rpmbuild]#

So, I cannot install Java on my VPS with Centos 5.2.

I can see that it refer to /usr/src/redhat/SOURCES/ - I am not sure how to install it.

Please help me to install Java on my VPS.

Thanks in advance