3 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4 * Copyright (C) $$Year-Rel$$ The Jalview Authors
6 * This file is part of Jalview.
8 * Jalview is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 <title>Building Jalview from Source</title>
24 <h1>Building Jalview from Source</h1>
27 You will need the following (hopefully):<br>
29 <li>Java development kit (JDK1.6 is the recommended platform for developing with Jalview, although JDK1.7 seems to work too!).</li>
30 <li>Ant (we think 1.5.4 is quite sufficient to use the simple build
31 file supplied, and it seems to work with later versions e.g. 1.7).</li>
33 With any luck, after setting your paths and JAVA_HOME correctly, you
34 just need to change to the Jalview directory and run ant (this works
35 from JBuilder and eclipse too, but NetBeans is a bit trickier).
41 <p><strong>Building a webstart version of jalview</strong></p>
42 Jalview depends on several libraries contained in the libs directory
43 of the distribution. In order to access them, they must all be signed
44 jars - using the same jarsigner key as jalview itself. There is a
45 build target in ant to make the signed jar files in a directory called
46 dist. But first you need to make your own key:
47 <p><strong>Making your own key</strong></p>
49 <p>The ant 'makefulldist' target assumes that a keystore exists in
50 a directory 'keys'. To make a key accessible using the default
51 settings in the build.xml file then make the keys directory and add
52 the jarsigner key with the following :</p>
54 <pre>keytool -genkey -keystore keys/.keystore -keypass alignmentisfun
55 -storepass alignmentisfun -sigalg SHA1withRSA -keyalg RSA -alias jalview</pre>
56 <em>(you will have to answer some personal questions here)</em>
57 <pre>ant makedist -DWebStartLocation="file://.pathtojalviewsource./dist" -Dapplication.codebase="*"</pre>
58 <p>This should eventually generate a jalview.jnlp file in ./dist
59 along with a set of signed jars using the jalview key). In order to
60 test locally via webstart you'll now need to add 'file:/' to your
61 java webstart security exception list. Then:</p>
62 <pre>javaws file://.pathtojalviewsource./dist/jalview.jnlp</pre>
63 <p>Please remember to remove that entry afterwards, since it will leave
64 your system vulnerable to malicious code.
67 <strong>Building the JalviewLite applet<br>
68 </strong> The JalviewLite applet is compiled using a subset of the packages in
69 the src directory (specifically: MCView, and jalview.{datamodel,
70 analysis, appletgui, utils, schemes, api, structure}, and
71 com.stevesoft.*). Once compiled, these class files are obfuscated to
72 make the code run efficiently. To compile the applet Jar, use the
73 makeApplet task - optionally passing in a 'donotobfuscate' property to
74 the ant build (e.g. -Ddonotobfuscate=true) to disable obfuscation. </p><p>
75 The ant target 'pubapplet' can be used to compile install the
76 jalviewApplet.jar and any dependent jars (under appletlib) into a copy
77 of the examples directory created under the <em>outputDir</em> build
78 property (which defaults to the 'dist' directory).
81 <h1>using IDEs to build Jalview</h1>
82 <p>The Jalview source distribution includes project definitions for
83 Eclipse, Netbeans and some rather ancient Borland JBuilder .jpx
84 project files. These files should be sufficient to set up basic source
85 folders and build paths, but you will need to ensure that all .jar
86 files in the lib and appletlib directories are added to the build path
87 for your IDE project, and that the 'buildindices' target in Jalview's
88 build.xml is executed with the 'outputDir' ant property set to the
89 directory where the IDE expects to place compiled classes ('classes'
90 directory for eclipse, 'build/classes' for netbeans).</p>
91 <p>Note: It is generally not recommended that you distribute build
92 artefacts that were generated automatically via an IDE's own packaging
93 mechanism (e.g. Netbeans' executable Jar and dependent lib directory).
94 The hand-crafted ant build.xml is (currently) the only officially
95 supported method of building distributable versions of Jalview.</p>
97 <a href="mailto:help@jalview.org">Jalview development team</a>