TreeAnnatotor in terminal

626 views
Skip to first unread message

Michael Harvey

unread,
May 13, 2013, 11:26:46 PM5/13/13
to beast...@googlegroups.com
Hi,

I've been trying to run TreeAnnotator from the command line but I'm receiving the following error:

Command:
java -Xmx1024m -Xms1024m -cp ./lib/beast.jar dr.app.tools.TreeAnnotator

Stdout:
Exception in thread "main" java.lang.NoClassDefFoundError: dr/app/tools/TreeAnnotator
Caused by: java.lang.ClassNotFoundException: dr.app.tools.TreeAnnotator
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

I see others have had similar issues (mostly in Linux), but I haven't been able to find a solution for my machine (mac os 10.6).

Thanks for any assistance,

Mike Harvey

Andrew Rambaut

unread,
May 14, 2013, 2:26:47 AM5/14/13
to beast...@googlegroups.com
Hi Mike,

What this means is that Java isn't finding the beast.jar file where you said it was ('./lib/beast.jar'). The
simplest way is to specify the full path to where ever you have installed beast. Something like:

java -Xmx1024m -Xms1024m -cp /usr/local/BEAST/lib/beast.jar dr.app.tools.TreeAnnotator

Change the '/usr/local/BEAST/' to the directory where beast is residing.

Best,
Andrew

--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at http://groups.google.com/group/beast-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Harvey

unread,
May 14, 2013, 4:28:58 PM5/14/13
to beast...@googlegroups.com
Andrew,

Thanks for the quick response. I worked around the issue by using an older version of BEAST (1.6 instead of 2), which works without error. Unfortunately, the path doesn't seem to be the issue with BEAST 2, as specifying the complete path (java -Xmx1024m -Xms1024m -cp /Applications/BEAST 2.0.2pre/lib/beast.jar dr.app.tools.TreeAnnotator) gives the same error, and I am able to run BEAST without error in the command line using that path.

Thanks,

Mike

Andrew Rambaut

unread,
May 14, 2013, 5:22:26 PM5/14/13
to beast...@googlegroups.com
Mike,

The path below has a space in it. You will need to use '\ ' to say this is is part of the path rather than two different arguments on the command line.

Andrew

Remco Bouckaert

unread,
May 14, 2013, 6:08:05 PM5/14/13
to beast...@googlegroups.com
The class name dr.app.tools.TreeAnnotator is for version 1 and it looks like you are using the jar file for version 2.
For version 2, the class name changed to beast.app.treeannotator.TreeAnnotator, so that explains the ClassNotFoundException.

Also, the class is currently part of the beastii addon, so you have to add BEASTii.addon.jar in your class path as well. What should work is

java -Xmx1024m -Xms1024m -cp ./lib/beast.jar:$(path to BEASTii)/lib/BEASTii.addon.jar beast.app.treeannotator.TreeAnnotator

where you replace $(path to BEASTii) with the actual path to where the BEASTii add-on is installed -- which is probably /Users/$(your user name)/Library/Application Support/BEAST/BEASTii on a Mac.

Remco
Reply all
Reply to author
Forward
0 new messages