opentaps ERP+CRM, java and environment variables

I’m trying to set up opentaps ERP on my 11.2 box but am running into trouble with java. Opentaps requires that the full Sun java sdk is installed which I did with YAST.

In the installation instructions they say to make sure opentaps knows to use the Sun JVM

IMPORTANT: If your system already has gcj and you just installed new Sun JVM, you must tell opentaps ERP + CRM to use the Sun JVM instead of the GCJ JVM in /bin/java by specifying where the JVM is:

$ export JAVA_HOME=/usr/java/j2sdk_xxxx/

So firstly if I issue that export command, where is the JAVA_HOME variable placed?
Secondly, what is the path the Sun JVM I should be using. It’s a bit confusing as there are symlinks to other directories and then there are about 5-6 different options.
A few of the options I have are:
/usr/lib64/jvm/java
/usr/lib64/jvm/java-1.6.0
/usr/lib64/jvm/java-sun
/usr/lib64/jvm/java-1.6.0-sun
/usr/lib64/jvm/jre-sun

Just to say I’ve figured out part 2. JAVA_HOME needs to be set /usr/lib64/jvm/java-1.6.0-sun.

Still don’t know where the JAVA_HOME variable resides though. By doing env in the terminal I can see it listed with the other variables. It’s not in my bashrc.

I assume that you are setting up the ‘server’ portion of this opentab app? If so, are you running it as yourself, or does it run under a specific account? If it’s yourself, put the export command in:

~./profile

And then log out and back in. You can also skip the logout step if you simply issue the export command in a shell and then start the app from the same shell.

Now, having said this, you should be aware that a typical environment also have JAVA_ROOT, JDK_HOME and JRE_HOME defined, which may be interfering with your app. Set them accordingly.

Lastly, if you have correctly installed the SUN JDK, these environment variables should already be set correctly, so this may be an indication of a different problem.

Yes it’s the server and I set it up as myself. It doesn’t require root or admin privileges to set up.

I looked in .profile in my account but it’s virtually empty. I noticed the other java variables you mentioned in the list when I run env from the terminal as myself.

A bit puzzling but it’s working now.

On a SUSE box, a mysterious system called ‘alternatives’ is used to manage these Java environments. Some time ago, I found some documentation/man pages on this, but I forget they are now.

Most Java apps allow you set a specific JVM to use through their config files (on Tomcat, for example, you create a file called setenv.sh and put it in the /bin folder). It’s odd that this opentab app relies on environment variables managed outside of its startup scripts.

How about; **/etc/java/java.conf **- and no, you should not create setenv.sh or anything of the sort.

Tomcat respects the systemwide java/jdk_home variable - if any application defines a non-system variable java_home, it sucks. Badly.

I disagree. I run many different Java based and EE apps and they all have their own JVM requirements (IBM JVM, SUN JDK5 and SUN JDK6). Being able to contain the Java environments within themselves through Weblogic / WAS or Tomcat configuration is absolutely required.

As I said, they suck badly and smell of immensely poor design if they require specific Java engines or versions.

Really? An IBM, SAP or Oracle product that’s poorly designed? Now there’s a shock.

As I tell my customers: if it was easy, logical and intuitive, they didn’t have to pay me to do it for them. :slight_smile:

In their defense, though, the EE stack is not aligned at all with the JVM releases and lags years behind the JVM release cycle.