I'm running ubuntu and djatoka (which runs in tomcat) won't work with OpenJDK. So I set JAVA_HOME and JRE_HOME to the Sun java that I downloaded and exported the variables. When I start tomcat, it reports JRE_HOME to what I set.
However, when I actually look at the variables, they're pointing to OpenJDK and djatoka isn't working. I can't find anyplace where it's being hardcoded, and even when I drop the variable assignments in catalina.sh and export from there, the same thing happens.
What the heck is going on? Than开发者_如何学Pythonks,
kyle
- Did you start tomcat in the same session where you exported the value?
- Did you manually install tomcat or did you apt-get it?
- You can set the JAVA_HOME that tomcat must use in tomcat/bin/catalina.sh
You can also set it in
/etc/environment
. eg:JAVA_HOME=/usr/lib/jvm/java-6-sun https://help.ubuntu.com/community/EnvironmentVariables#System-wide environment variables
What operating system are you using? Try making sure you are setting those environment variables for the entire system and not the user.
Ubuntu uses a somewhat wired alternatives
system. Program in /usr/bin point to /etc/alternatives and from there it goes to /usr/share/jdk-something.
There is an easy way: Uninstall the OpenJDK and GCJ. But you might run into dependency-issues.
Or read about the alternatives-system.
man update-alternatives
should help. It's not that hard. A little complicated - that's all.
I should add, that the benefit of the alternatives system is, that you can have multiple installations of java in parallel (1.5, 1.6, 1.7 alpha, OpenJDK) and switch with one command all the links - to java, javac, appletviewer, javap and so on. Not to forget the CLASSPATH, afaik. And Updates from 1.6.23 to 1.6.24 are handled by Ubuntu flawlessly. But it is annoying to trace the links down to their root.
There is even a Java-shortcut for the alternatives:
update-java-alternatives --help
精彩评论