Merry Christmas & Happy New Year!
Using yum to install openjdk, simple and fast.
yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
java -version
nano /etc/profile
#Add the following lines at the bottom:
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/l
I didn't find obvious function that can return the results in stderr. So shell_exec is a general solution.
It's not some special function, but just something standard in shell. The answer is "2>&1". It means redirect message in stderr into stdout.
For example:
shell_exec("dir")
will return the
- 2012
- 2011
- 2010
