[Jalview-discuss] Import Jalview source code into Netbeans/Eclipse
jimp at compbio.dundee.ac.uk
Tue Feb 17 15:03:21 GMT 2009
Sorry to hear you are having problems, Sahil.
It sounds like you are using the 'Import project' function rather than
the 'Import source' function of your IDE - the former usually expects
the archive containing the project to have some kind of meta-data. The
jalview source distribution intentionally lacks this kind of IDE
specific data, but it should be quite easy to import it into any
standard Java IDE.
sahil seth wrote:
> I am unable to import the source code of Jalview into a project of
> Netbeans or Eclipse.
1. Create a new project where you have (at least in eclipse) specified a
distinct source folder called 'src', and a distinct build folder called
2. Unpack the source distribution and copy all the files under jalview/
into the new project's folder. This will overwrite the src directory
with the one of the same name containing jalview's source.
3. Configure your project's build and runtime dependencies
- all the dependencies needed to run jalview are in jalview/lib
- Use the ant build script (jalview/build.xml) to build jalview
* for this to work correctly, add jalview/utils to the ant classpath
and the build classpath to resolve the remaining compile-time dependencies
- look at the output of the default build target to see what each of
the different targets do.
> I with to incorporate jalview inside a java application.
> Please guide
It depends on how experienced you are with NetBeans/Eclipse. From an
eclipse perspective, all you need to do is import the source into a
project and configure the default builder to execute the 'makejars'
target on the ant build script - this will make the jalview.jar file in
a new directory jalview/dist. All you then need to do is add the
jalview.jar + other lib/*.jar files into your program's project as a
dependency. I'm not sure precisely how to go about doing this in
NetBeans - but it's probably very similar in practice (import sources,
set up project dependencies. configure builder + classpath, share
jalview.jar from build output as a dependency for your own program's
If this all sounds too complex, then you can just copy all the source
files from the jalview/src directory into your own project, and
carefully add all the jars under jalview/lib to your own project's
library set. However, that completely depends on how you have configured
your own program's builder. You may also experience some library version
conflicts - jalview utilises the axis-1.2 library for historical
reasons, and also has a specially patched version of the XML binding
library castor (1.1-cycle). If your program does use other versions of
these jars, then some aspects of Jalview will not work (webservices or
the jalview XML project). Otherwise, be very careful to test both
jalview and your program if you upgrade/downgrade any other jars that
they both rely on.
best of luck
ps. if you don't want to do anything more than launch jalview from
another application with a predefined set of arguments, then consider
using the launchApp servlet to launch jalview via webstart (or even
generate your own JNLP file directly!). There's a post that describes it
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.
More information about the Jalview-discuss