Is Tomcat6 the requirement? What version of Centos? (I'm assuming "Tomcat of some sort" and "current Centos" which would be 5.3 as of this writing)
You don't need the jpackage repo unless you want Tomcat 6. Also, Centos 5.3 ships with openjdk 1.6.0, which has passed the Java SE 6 TCK.
Simply "yum install tomcat5" should pull in all the dependencies you would need (including openjdk), many of which will be based off the jpackage sources. Once it's installed, all you need is "service tomcat5 start" to start it up. NOTE: Running your web container as root is very, very bad because it is a massive security risk. The tomcat5 service installed by the repository version will drop its permissions to a 'tomcat' user with more limited permissions. To have tomcat start automatically when the system boots, use "chkconfig tomcat5 on".
In your case above, the port 8080 is probably blocked by the default firewall. You can turn the firewall off (recommended only for testing connectivity, do not run without the firewall in production) with "service iptables stop". Centos provides both a GUI and Text UI tool (system-config-securitylevel and system-config-securitylevel-tui respectively) for modifying the firewall, or you can use iptables directly (see 'man iptables').
I'm not sure what you mean exactly by your questions, but...
Find the install for openjdk-7-jre-headless
You can do this by using apt-get
at the command line:
apt-get install openjdk-7-jre-headless
Follow the prompts and it'll install this package and everything it needs.
sudo export home, as I've had problems in the past setting the export home, without proper access
If you execute the command sudo export home
, it does nothing - and wouldn't work. export
is a shell internal command, and sudo
requires a binary. Even if you made that command work through shell trickery, you'd just set the variable (which should be JAVA_HOME
) in a new shell then forgets it when the command is done.
You might need to run java
as root, but I wouldn't do that either: fix the permissions on the files and executables, and don't run as root as this will open your system up to hackers and miscreants.
Best Answer
You should download the
jdk-7u3-linux-i586.tar.gz
orjdk-7u3-linux-x64.tar.gz
and simply uncompress one of those archives.It is enough to install a JDK (Java SE Development Kit 7 Downloads)
And it is quite different from installing a Java Platform, Enterprise Edition 6 SDK Update 3 (with JDK 7), from the Java EE 6 SDK Downloads (which, indeed, might require a GUI).