Problems running under Linux

One problem you may encounter is the following error when attempting to run BEAST or BEAUti under Linux.

Exception in thread "main" java.lang.NoClassDefFoundError:
   at java.lang.Class.initializeClass(
   at dr.util.MessageLogHandler.<init>(Unknown Source)
   at<init>(Unknown Source)
   at Source)
Caused by: java.lang.ClassNotFoundException: not found in
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.lang.ClassLoader.loadClass(
   at java.lang.ClassLoader.loadClass(
   at java.lang.Class.forName(
   at java.lang.Class.initializeClass(
   ...3 more
If you see this you are trying to run the programs with the wrong version of the JVM. Either you haven’t installed the Java JVM or you have installed it but haven’t told linux you want to use the Java JVM by default.
The way to fix this will depend on what kind of linux you are running. If you are running Debian then use the update-java-alternatives command…
$ sudo /usr/sbin/update-java-alternatives --config java

There are 5 alternatives which provide `java'.

  Selection    Alternative
          1    /usr/lib/jvm/java-6-sun/jre/bin/java
          2    /usr/bin/gij-4.3
          3    /usr/lib/jvm/ia32-java-6-sun/jre/bin/java
*+        4    /usr/lib/jvm/java-gcj/jre/bin/java
          5    /usr/bin/gij-4.2

Press enter to keep the default[*], or type selection number: 1
Using '/usr/lib/jvm/java-6-sun/jre/bin/java' to provide 'java'.

and you should be ready to run.
Note: it’s best not to use the update-alternatives command for this. Instead, use the update-java-alternatives because “The former just sets the symlinks for the /usr/bin/java alternative, whereas the update-java-alternatives sets all java-related symlink”

Leave a Reply

Bayesian evolutionary analysis by sampling trees