Howdy - running Wowza on a cloud based Ubuntu instance. We take the server down when we don’t need it, but Wowza won’t start when we bring the instance back up. To start it, i can ssh in, switch to root and enter
/etc/init.d/WowzaStreamingEngine start
/etc/init.d/WowzaStreamingEngineManager start
and the server will start without any problems.
In the boot.log file, i see this:
ERROR: The Java command (java) could not be found.
Search path: /sbin:/usr/sbin:/bin:/usr/bin
In most cases this problem can be fixed by adding a symbolic
link to the Java command in the /usr/bin directory.
To do this first execute the command "which java" to identify
the full path to the Java executable. Next, create a symbolic
link to this file with the command
"ln -sf [path-to-java] /usr/bin/java" where [path-to-java] is
the path returned by the "which" command.
I have java downloaded and unpacked in
/use/jre/jdk1.8.0_05/
and i altered my /etc/enviroment file to look like this:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/jre/jdk1.8.0_05/bin"
JAVA_HOME="/usr/jre/jdk1.8.0_05/"
It’s barebones Ubuntu 13.10 and other than that, there are no issues. Not sure what i am missing to get Wowza to find java at boot time.
thx, gw
Hi
Can you run the following command as root to see how your java environment is currently set up:
# update-alternatives --display java
This should show the current path to the java binary.
An alternative command on some distros (which should show the same result) is:
# update-java-alternatives -l
It may also be useful to see how the java binary is currently set
# which java
/usr/bin/java
If it does not return with a path then there is likely a problem with your Java environment.
Generally with Ubuntu distros you should find a symbolic link in /usr/bin/java to /etc/alternatives/java
# cd /usr/bin
# ls -l java
java -> /etc/alternatives/java
# cd /etc/alternatives
# ls -l java
java -> /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java (example for openjdk java install)
If you are not finding any link to the physical java binary then this is likely to be your problem. Using the Ubuntu package management tools you should be able to manage this environment.
Try running
# apt-get install openjdk-7-jdk
to install the OpenJDK environment.
hi
Generally the way to keep it as simple (and sometimes as thin) as possible is to just use the built in package manager. Pretty much all major distros these days have very robust package management tools and it makes for an easier to manage and easily supportable environment. Personally I would look at installing the java open jdk (openjdk-7-jdk) and possibly java-common if that’s not incorporated with the jdk install.
Paul
PS -
# cd /usr/bin
# ls -l java
java -> /usr/jre/jdk1.8.0_05/bin
In this case it is showing java is found (as a symlink) in /usr/bin/ which conflicts with your first post which shows that java can not be found in your search path of “sbin:/usr/sbin:/bin:/usr/bin”. Has anything changed?
Hi Paul - i downloaded and unpacked java from the oracle website. i didn’t actually install it, so here are the results of those commands:
# update-alternatives --display java
update-alternatives: error: no alternatives for java
# update-java-alternatives -l
The program 'update-java-alternatives' is currently not installed. You can install it by typing:
apt-get install java-common
# which java
/usr/jre/jdk1.8.0_05/bin/java
should i just undo everything and install open jdk? trying to keep this server as thin as possible…
thanks again, gw
PS -
# cd /usr/bin
# ls -l java
java -> /usr/jre/jdk1.8.0_05/bin
ok i will undo all of my actions so far - shouldn’t be a big deal - and install the open jdk instead. thanks for your help.
gw