d3b5f0af0d1bf468917bbda5799eb0e355df1c6a
[jalview.git] / doc / building.html
1 <html>
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
4  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5  * 
6  * This file is part of Jalview.
7  * 
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.
11  *  
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.
16  * 
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 -->
19 <head>
20 <title>Building Jalview from Source</title>
21 </head>
22 <body>
23 <h1>Building Jalview from Source</h1>
24 <P>
25 <p>
26 You will need the following (hopefully):<br>
27 <ul>
28 <li>Java development kit (JDK1.6 is the recommended platform for developing with Jalview, although JDK1.7 seems to work too!).</li>
29 <li>Ant (we think 1.5.4 is quite sufficient to use the simple build
30 file supplied, and it seems to work with later versions e.g. 1.7).</li>
31 </ul>
32 With any luck, after setting your paths and JAVA_HOME correctly, you
33 just need to change to the Jalview directory and run ant (this works
34 from JBuilder and eclipse too, but NetBeans is a bit trickier).
35 <pre>
36    ant
37 </pre>
38
39 </p>
40 <p><strong>Building a webstart version of jalview</strong></p>
41 Jalview depends on several libraries contained in the libs directory
42 of the distribution.  In order to access them, they must all be signed
43 jars - using the same jarsigner key as jalview itself. There is a
44 build target in ant to make the signed jar files in a directory called
45 dist. But first you need to make your own key:
46 <p><strong>Making your own key</strong></p>
47
48 <p>The ant 'makefulldist' target assumes that a keystore exists in a
49 directory 'keys'. To make a key accessible using the default settings
50 in the build.xml file then make the keys directory and add the
51 jarsigner key with the following :
52 </p>
53 <pre>
54 mkdir keys
55 keytool -genkey -keystore keys/.keystore -keypass alignmentisfun
56 -storepass alignmentisfun -alias jalview
57  (you will have to answer some personal questions here)
58 ant makedist
59  (should eventually generate a Jalview.jnlp file
60   in ./dist along with a set of signed jars using the jalview
61   key)
62 </pre>
63
64         <p>
65                 <strong>Building the JalviewLite applet<br>
66                 </strong> The JalviewLite applet is compiled using a subset of the packages in
67                 the src directory (specifically: MCView, and jalview.{datamodel,
68                 analysis, appletgui, utils, schemes, api, structure}, and
69                 com.stevesoft.*). Once compiled, these class files are obfuscated to
70                 make the code run efficiently. To compile the applet Jar, use the
71                 makeApplet task - optionally passing in a 'donotobfuscate' property to
72                 the ant build (e.g. -Ddonotobfuscate=true) to disable obfuscation. </p><p>
73                 The ant target 'pubapplet' can be used to compile install the
74                 jalviewApplet.jar and any dependent jars (under appletlib) into a copy
75                 of the examples directory created under the <em>outputDir</em> build
76                 property (which defaults to the 'dist' directory).
77         </p>
78         <p>
79 <h1>using IDEs to build Jalview</h1>
80         <p>The Jalview source distribution includes project definitions for
81                 Eclipse, Netbeans and some rather ancient Borland JBuilder .jpx
82                 project files. These files should be sufficient to set up basic source
83                 folders and build paths, but you will need to ensure that all .jar
84                 files in the lib and appletlib directories are added to the build path
85                 for your IDE project, and that the 'buildindices' target in Jalview's
86                 build.xml is executed with the 'outputDir' ant property set to the
87                 directory where the IDE expects to place compiled classes ('classes'
88                 directory for eclipse, 'build/classes' for netbeans).</p>
89         <p>Note: It is generally not recommended that you distribute build
90                 artefacts that were generated automatically via an IDE's own packaging
91                 mechanism (e.g. Netbeans' executable Jar and dependent lib directory).
92                 The hand-crafted ant build.xml is (currently) the only officially
93                 supported method of building distributable versions of Jalview.</p>
94 <address>
95 <a href="mailto:help@jalview.org">Jalview development team</a>
96 </address>
97 </body>
98 </html>