It is always interesting to run into JVM issues on Solaris servers which you think would just work. If you’re used to working in Linux, a simple java -version would suffice, but if you look at the same output from a JRE on a Solaris box you may encounter the similar output like so
bash$ $JAVA_HOME/bin/java -version java version "1.6.0_21" Java(TM) SE Runtime Environment (build 1.6.0_21-b06) Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)
and you might ask is that 32-bit or 64-bit? Doing a file $JAVA_HOME/bin/java will definatively tell you the version, but on a Solaris box, it may be 32-bit and you will probably want 64-bit.
bash$ file $JAVA_HOME/bin/java /opt/java/jre1.6.0_21/bin/java: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped, no debugging information available
All you need to do is:
- Install the version of the 32-bit JRE that you desire
- Then install the 64-bit version right on top of it, in the same directory.
Notice the 64-bit installer unpacks some binaries in sparcv9 directories, and the 64-bit version of the JVM can now be seen in
bash$ file $JAVA_HOME/bin/sparcv9/java /opt/java/jre1.6.0_21/bin/sparcv9/java: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
All that needs to be done after that is adding is to add the -d64 flag to your $JAVA_OPTIONS and you can use $JAVA_HOME/bin/java normally. You can just run it directly with the flag to confirm:
bash$ $JAVA_HOME/bin/java -version -d64 java version "1.6.0_21" Java(TM) SE Runtime Environment (build 1.6.0_21-b06) Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)