« How the THX Noise Was Created | Main | Road Trip: Utah and the San Rafael Swell »
June 29, 2006
Aerith Source Released!
After a bit of a wait since JavaOne, the Swing Team has finally been able to release the source for their demo application Aerith! I would have posted about it yesterday, but I wanted to get it running first. In case you don't know what Aerith is, it is an application that allows you to view your flickr photos and create a trip report from them. Being a fellow Flickr application developer, I was very interested to see this app for myself. There are a few blogs about Aerith from the developers, but none of them give you any instruction on how to get Aerith up and running. So I decided to do that for myself. Read on to see how I got Aerith running on Mac OS X. Congrats to the Swing team! Now if they would just release the Extreme GUI Makeover source!
First, these instructions are very Netbeans centric. So if you aren't using netbeans, you will probably be in the dark...hehe.
To get Aerith up and running, you first need to go check out the source code. Aerith is controlled in a Subversion repository on java.net, so you will need a subversion client to check out the source. You can find one here, but I used this one for OS X because the fink version is behind...Once you have installed svn, open the Terminal and create a directory to check things out into.
# mkdir aerith.trunk
# cd aerith.trunk
# svn checkout https://aerith.dev.java.net/svn/aerith/trunk aerith --username guest
With the code checked out, launch netbeans and open the Aerith project. From here I learned of a few dependancies Aerith had:
1 - Java SE 6.0
2 - The SwingX project
3 - JOGL (I knew they were using it, but you have to get it seperately.)
So I'll tell you how to get all 3.
#1 - Java SE 6.0 - It is currently still in beta if you didn't know. If you are running Mac OS X, you can get the Java SE 6 Preview from the Apple Developer Connection. You must be a member (it's free) to download it. So go get it! Download and install it.
After you have installed it, in netbeans, go to the Tools menu and open the Java Platform Manager. Click Add Platform. It took me right to where all the versions are, but in case it didn't for you, browse to here:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6 and select Home
You done with that
#2 - SwingX - SwingX is another java.net project that can be found here:
https://swingx.dev.java.net
You must be a java.net member to get this project, so log in and click on the Version Control - CVS link on the left. It will give you the CVS commands you need to check out swingx. I checked it out in the same directory as my aerith baseline.
After you checked that out, open that project in netbeans. This project will complain about a reference problem. Right Click on the project and go to Resolve Reference Problems. It is missing JMock. Click resolve and it will take you the Library Manager. Add a new library and call it JMock. Then add a jar to it - browse to the swingx/lib dir and select the JMock jar. SwingX should be happy now.
#3 - JOGL - This is the Java™ Binding for the OpenGL® API. It is also another java.net project! (Imagine that!) This one you can just download. Go to https://jogl.dev.java.net/ and then click on Documents and Files. Then browse to jogl-> Release Builds 2006-> JSR-231 beta 05 - June 8. Download the jogl.jar and find the jogl-natives for you platform. Mine was jogl-natives-macosx-universal.jar. Put both of these into the aerith/lib directory. Unpack the jogl-native jar into the lib directory.
Then in netbeans, Resolve Reference Problems for the aerith project. It is missing 2 jars. jogl.jar and jl1.0.jar. Click resolve and browse to the lib directory and select the one you choose to resolve. Both should be resolved now. If not, browse to the other one as well.
Now we have to tell aerith which Platform to run with. Get properties on the aerith project. Go to libraries and at the top should be the Java Platform. Select the Java 1.6.0.
And last, you have to tell the VM where your JOGL native libraries are. Still in the properties for the aerith project, go to the Run selction. In the VM Options, add the following to the very end:
-Djava.library.path=lib
You should now be set to build and run Aerith! It will launch and ask for your flickr account name. If you don't have one and just want to see it run, put mine in: serff.
Hopefully this has been useful to someone out there. Please let me know if it was!
Posted by Andrew at June 29, 2006 10:01 PM
Comments
Hi !
I just run Aerith for the first time ! Very nice UI, but very buggy with my configuration (mind you, it's all Beta ! ;) ):
I partly followed your instructions to run Aerith on Mac OS X Tiger (10.4.7) with the beta release of Java 1.6 Mustang (1.6.0-b82-6), using IntelliJ IDEA instead of Netbeans (EAP Demetra 5350). IDEA itself was running on the latest 1.5 JVM provided by Apple.
I got a bunch of these:
"
java(1418,0x190aa00) malloc: *** Deallocation of a pointer not malloced: 0x3c2ed0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug"
"
This one came a few times:
"
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Zero length string passed to TextLayout constructor.
at java.awt.font.TextLayout.(TextLayout.java:364)
at org.progx.twinkle.ui.PictureViewer.generateTextImage(PictureViewer.java:375)
"
All ended with this native Hotspot VM crash:
"
# An unexpected Java error has been detected by HotSpot Virtual Machine.
#
# If this error is reproducible, please report it with the following information:
# 1. Provide the steps to reproduce, a test case, and any relevant information
# 2. The corresponding JavaNativeCrash_pid.crash.log (Java state)
# 3. The corresponding .crash.log (native state; generated by CrashReporter)
# 4. This data:
#
# Java VM: Java HotSpot(TM) Core VM (1.6.0-b82-6-release interpreted mode, sharing)
# An unexpected error has been detected by Java Runtime Environment:
#
# Bus Error (0xa) at pc=0x9f776a74, pid=1418, tid=25189888
# An error report file with more information is saved as /Users/danielweck/Library/Logs/Java/JavaNativeCrash_pid1418.crash.log
#
#
# File report at: http://bugreport.apple.com/
"
;)
Pretty common with the beta Mustang on Mac OS X, I already filled a bug or two.
For example, I can run FreeMind but cannot open the preference panel (JOptionPane compatibility issue).
More annoyingly, I can run IDEA on Mustang but most commands will fail because of Java exceptions all over the place.
Anyways, Aerith looks great on my machine, maybe just a little slow sometimes, but any Swing application feels sluggish on Mac OS X as opposed to Windows.
By the way, I get this message when lauching Aerith, does this mean the UI is not OpenGL-accelerated ?
"[TWINKLE] OpenGL pipeline work around: false"
Cheers, Daniel/
Posted by: Daniel WECK at June 30, 2006 6:33 AM
Hey Daniel,
"[TWINKLE] OpenGL pipeline work around: false" actually refers to a workaround that Romain put into the "twinkle" part of Aerith (the 3d slide show). He had to do a lot of tweaking of the jogl code. I think this particular work around was for antialiasing, but I don't remember. A command line flag will set it to be on or off.
The 3d part will always be running on OpenGL -- but it may be using JOGL directly or it may be going through the Java2D/JOGL pipeline. It depends on whether Java2D openGL is turned on or not. I don't remember the exact command line switch, but it is something like -Dsun.java2d.opengl=True.
Cheers, Richard
Posted by: Richard at June 30, 2006 8:03 AM
Hi, I had the same exception too:
[ATHENA] Use large picture: true
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Zero length string passed to TextLayout constructor.
at java.awt.font.TextLayout.(TextLayout.java:364)
at org.progx.twinkle.ui.PictureViewer.generateTextImage(PictureViewer.java:382)
at org.progx.twinkle.ui.PictureViewer.access$1800(PictureViewer.java:61)
at org.progx.twinkle.ui.PictureViewer$SlideAnimation.(PictureViewer.java:619)
at org.progx.twinkle.ui.PictureViewer$SlideAnimation.(PictureViewer.java:607)
at org.progx.twinkle.ui.PictureViewer.showPicture(PictureViewer.java:325)
at org.progx.twinkle.ui.PictureViewer.nextPicture(PictureViewer.java:201)
at org.progx.twinkle.ui.PictureViewer$NextPictureAction.actionPerformed(PictureViewer.java:814)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:377)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:232)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6066)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3203)
at java.awt.Component.processEvent(Component.java:5831)
at java.awt.Container.processEvent(Container.java:2028)
at java.awt.Component.dispatchEventImpl(Component.java:4473)
at java.awt.Container.dispatchEventImpl(Container.java:2086)
at java.awt.Component.dispatchEvent(Component.java:4303)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4292)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3956)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3886)
at java.awt.Container.dispatchEventImpl(Container.java:2072)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4303)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:300)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:210)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:195)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:187)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception in thread "Thread-6" java.lang.IllegalArgumentException: Zero length string passed to TextLayout constructor.
at java.awt.font.TextLayout.(TextLayout.java:364)
at org.progx.twinkle.ui.PictureViewer.generateTextImage(PictureViewer.java:382)
at org.progx.twinkle.ui.PictureViewer.access$1800(PictureViewer.java:61)
at org.progx.twinkle.ui.PictureViewer$SlideAnimation.(PictureViewer.java:619)
at org.progx.twinkle.ui.PictureViewer$SlideAnimation.(PictureViewer.java:607)
at org.progx.twinkle.ui.PictureViewer.showPicture(PictureViewer.java:325)
at org.progx.twinkle.ui.PictureViewer.access$1000(PictureViewer.java:61)
at org.progx.twinkle.ui.PictureViewer$2.run(PictureViewer.java:305)
at java.lang.Thread.run(Thread.java:637)
Any idea?
BTW, this was a useful doc.
Cheers,
LP
Posted by: Loreto Parisi at July 23, 2006 9:51 AM
LP,
I'm no expert on Aerith, I just got it running on OS X. Richard or Romain would be the realy people to ask about it. There are mailing lists for aerith that you could try to get your question answered on though. They can be found here: https://aerith.dev.java.net/servlets/ProjectMailingListList. Thanks for letting me know you found this article useful!
Andrew
Posted by: serff
at July 23, 2006 1:18 PM
Hi!
I have followed your instructions to run Aerith in my PC. But when I try to build Aerith, I get the following error:
(the last part)
Created dir: C:\proyectos swingx\swingx\dist
Building jar: C:\proyectos swingx\swingx\dist\swingx.jar
Manifest is invalid: Manifest sections should start with a "Name" attribute and not "X-COMMENT"
C:\proyectos swingx\aerith\nbproject\build-impl.xml:234: The following error occurred while executing this line:
C:\proyectos swingx\swingx\nbproject\build-impl.xml:323: Invalid Manifest: C:\proyectos swingx\swingx\manifest.mf
BUILD FAILED (total time: 25 seconds)
Anybody knows something about it?
Thanks in advance.
Posted by: itelleria at August 2, 2006 3:37 PM