miércoles, 13 de octubre de 2010

Glassfish installation broken after ubuntu update.

Yesterday I updated from Ubuntu 10.04 to 10.10 and all seems to be working fine. The only problem I found is that my glassfish v2 installation is broken and when I tried to start the server from the shell I got this error:


./asadmin start-domain command
./asadmin: 19: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/../bin/java: not found


To resolve this problem you can follow this workaround:

First I find that after update, my official SUN JDK was replaced with OpenJDK that doesn't work quite well with glassfish. So the first step is completly uninstall the OpenJDK or at least change the current path to /usr/bin/java.

To set the Java PATH to the official JDK execute this command and select SUN Java implementation:


sudo update-alternatives --config java
Hay 2 opciones para la alternativa java (proporcionando /usr/bin/java)

Selección Ruta Prioridad Estado
------------------------------------------------------------
0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo automático
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo manual
* 2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 modo manual



Next I set the JAVA_HOME adding this lines to the end of /etc/bash.bashrc:


JAVA_HOME="/usr/lib/jvm/java-6-sun"
export JAVA_HOME


Finally, fix the AS_JAVA property in ../glassfish/config/asenv.conf to the correct path:


AS_JAVA="/usr/lib/jvm/java-6-sun"


Done, now glassfish should start and work flawlessly.

3 comentarios:

  1. Thank you bro, you saved my life!!! :-)

    ResponderEliminar
  2. Happy to help. You are the first to comment in our blog! :)

    ResponderEliminar
  3. Este comentario ha sido eliminado por el autor.

    ResponderEliminar