Amazon ec2 tools - choosing the right JVM

code-complete

Tuesday, April 1. 2008

Amazon ec2 tools - choosing the right JVM

I have just gotten around to using the amazon ec2 tools to manage my amazon machine images from my linux laptop. I mentioned before that I am rolling with fedora 8 on a new laptop, and it's been sweet. But there are gotchas here and there and I ran into one today with the ec2 tools.

Turns out that fedora 8 comes with 2 JVMs: GCJ 1.5.0 and IcedTea 1.7.0 - those are installed via yum or selected during the install process. I have no problems with any java-based GUI apps that I have installed like Oxygen and dbvisualizer, but when running the ec2-describe-images command, I got the following error:


Exception in thread "main" java.lang.NoClassDefFoundError:
org.codehaus.xfire.aegis.type.xml.SourceType
at java.lang.Class.initializeClass(libgcj.so.8rh)

etc....


I had my JAVA_HOME set to what redhat and fedora lilke: /usr/lib/jvm/java, which is really a sym link pointing into the /etc/alternatives library of sym links. It's actually a great way to switch globally between JVMs, because you can use the system-switch-java applet to quicky change your JVM if you have multiple versions installed. So I did and switched from 1.7 over to GNU 1.5 and tried again. Same exception was thrown.

It turns out the the ec2 tools really only work with Sun's JVM, which I downloaded and installed via the RPM from sun.com. After installing, uninstalling, reinstalling a few times I determined that for whatever reason the 1.6 JVM from Sun was never going to appear as an option within the system-switch-java applet. So I changed my JAVA_HOME variable from /usr/lib/jvm/java to /usr/java/default, which is what Sun likes.

Now the ec2 command line tools work great!

Posted by thaddeus in Redhat Linux at 15:43 | Comments (2) | Trackbacks (0)

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

Thanks for posting this. I had some problems getting the commands working myself and I was able to get it working with the same method. Saved me quite a bit of time troubleshooting.
#1 Brian Fehrle on 2010-05-20 10:57 (Reply)
Thanks for posting this. After I downloaded and installed jre-6u21-linux-i586.bin. I was able to get it working with the same method, too.
#2 Anonymous on 2010-08-12 01:42 (Reply)

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
Submitted comments will be subject to moderation before being displayed.
 

About Me

Thaddeus Wakefield Batt
Thaddeus Wakefield Batt

blogging from: denver, co.

blogging about: web technologies

Links

Tech Blogs
Fullasagoog - RIA
John Wilker
William .NET
Graphex

Links
SpireMedia, Inc.
The CMS Matrix




Lijit Search

Archives

  • May 2013
  • April 2013
  • March 2013
  • Recent...
  • Older...

Categories

  • XML .NET
  • XML Apollo
  • XML Coldfusion Programming
  • XML Coldfusion Server
  • XML Flex
  • XML Information Architecture
  • XML Java
  • XML Livecycle
  • XML postgreSQL
  • XML Redhat Linux
  • XML Silverlight
  • XML SpireMedia
  • XML SQL Server 2k5
  • XML Tools of the Trade
  • XML Vista
  • XML Win2K3 Server
  • XML Windows Server 2008
  • XML Zimbra


All categories

Syndicate This Blog

  • XML RSS 0.91 feed
  • XML RSS 1.0 feed
  • XML RSS 2.0 feed
  • ATOM/XML ATOM 0.3 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments

Blog Administration

Open login screen

Thaddeus Batt

Creative Commons License - Some Rights Reserved
Original content in this work is licensed under a Creative Commons License