Sunday, May 18, 2008

Checking out projects from Java.net through Netbeans

Hi folks,
Recently I got interest(not sure from where) in CVS and SubVersioning. The features(integration etc) provided by NetBeans is excellent to do check outs. Be it CVS or SVN.
Out of curiosity I decided to check out a special project hosted on java.net. It is Aerith.
It has many dependencies. It requires JDK 6.0 and later versions to run. You need to download JOGL . Be sure to download jogl.jar as well as the jogl native libraries for your platform.
Install JOGL by unjarring the jogl-natives[your platform].jar file. It should create several native libraries. Put the native libs in your library path(/usr/lib/ in my case) and the jogl.jar in your classpath. It also requires dependency jar files like JLayer 1.0 and TimingFramework .
Now you need to check out the source code for swingx . For this to happen you need to create an account on java.net.
Open NetBeans, go to Versioning->CVS->Checkout as shown,



then enter the name of the module.


Click finish. You will see the source code being downloaded to the above mentioned directory.


Now you need to download the code for Aerith project from SVN. To check whether svn is installed or not on linux type svn in console. You need to download the rpm package or the source code to install it otherwise. You will get further information about SVN on linux here. Download and instaalation instructions are here. I just did apt-get install svn (I use kububtu Hardy Heron).
Check out the version of svn by issuing svn --version command. NetBeans needs another svn client to be installed on your system. NetBeans 6.1 supports versions > 1.3. The clients which I know are kdesvn and rapidsvn.

After you install a svn client you need to provide the installation path of these clients to NetBeans. By default it is /usr/lib/ on linux. Go to Versioning->Subversion->Checkout. It'll ask you to enter the path. If it is proper you should see a window similar to this.

Input the proper repository URL and click Next,

If you are not sure about the repository folder click browse button. Browse the repository for folder containing the proper source code and click finish.

Now that the checking out is over , you need to resolve certain dependencies. Open the project you checked out. Right click on the project and go to Resolve Reference Problems. Click on resolve to locate the required jar libraries on your system. Now you need to tell Netbeans where your Jogl.jar is. Right click on Libraries under your project tree. Then click on Add JAR/Folders and locate the relevant jar file. Now build the project.
Note: I got the following errors:
init:
deps-jar:
Created dir: /home/rajath/NetBeansProjects/trunk/build/classes
Compiling 99 source files to /home/rajath/NetBeansProjects/trunk/build/classes
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/g2d/AnimationUtil.java:20: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/ui/ActionButton.java:35: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/ui/WaitOverlay.java:31: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/ui/fullscreen/IndyFullScreenRenderer.java:49: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
BUILD FAILED (total time: 6 seconds)


Click on the errors to navigate to the respective location of the source code and try to resolve unused imports. Save it and rerun the project.
Ah.. Now you must be able to see the gorgeous Aerith window. Enter your Flickr username and enjoy. If your username is invalid you may end up in getting Exceptions.
Few ScreenShots of Aerith:

You can browse photos. You can prepare a trip report and do lots more.

It is a Filthy Rich Client Application.

No comments: