f5e0b2896615eca8bd0437aa20d0d174c35c283f
[jalview.git] / doc / building-OLD.html
1 <html>
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4  * Copyright (C) $$Year-Rel$$ The Jalview Authors
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  * The Jalview Authors are detailed in the 'AUTHORS' file.
19 -->
20 <head>
21 <title>Building Jalview from Source</title>
22 </head>
23 <body>
24 <h1>Building Jalview from Source</h1>
25 <p/>
26
27 <p>
28 You will need the following:<br/>
29 <ul>
30   <li> Obtain: git</li>
31   <li> Build/run: Java Development Kit (JDK). JDK11 is now the recommended platform for developing with Jalview.  You can obtain a pre-compiled JDK11 for many platforms from https://adoptopenjdk.net/</li>
32   <li> Build: Gradle 5.1 or later.  On linux you can obtain this with your package manager (e.g. <code>sudo yum install gradle</code> or <code>sudo apt install gradle</code> or on macOS with brew with <code>brew install gradle</code></li>
33 </ul>
34 With any luck, once you check out the Jalview source from git and set your JAVA_HOME and PATH correctly, you just need to change to the <code>jalview</code> directory and run <code>gradle getdown</code>.
35 </p>
36
37 <h2>Obtaining Jalview</h2>
38 <p>This is easiest achieved with git:
39 <pre>git clone http://www.jalview.org/git/jalview.git</pre>
40 Then you can <code>cd jalview</code> to get into the top level jalview dir.
41
42
43 <p>
44 <h2>Minimal Jalview build</h2>
45 <p>To run Jalview, you just need the jalview classes and the .jar libraries that Jalview depends on.</p>
46
47
48 <!--
49 <p>
50 You will need the following (hopefully):<br>
51 <ul>
52 <li>Java development kit (JDK1.8 is now the recommended platform for developing with Jalview.</li>
53 <li>Ant (1.7 or later will be needed for some of the jarsigning tools).</li>
54 </ul>
55 With any luck, after setting your paths and JAVA_HOME correctly, you
56 just need to change to the Jalview directory and run ant (this works
57 from eclipse too, but NetBeans is a bit trickier).
58 <pre>
59    ant
60 </pre>
61
62 </p>
63 <p><strong>Building a webstart version of jalview</strong></p>
64 Jalview depends on several libraries contained in the libs directory
65 of the distribution.  In order to access them, they must all be signed
66 jars - using the same jarsigner key as jalview itself. There is a
67 build target in ant to make the signed jar files in a directory called
68 dist. But first you need to make your own key:
69 <p><strong>Making your own key</strong></p>
70
71   <p>The ant 'makefulldist' target assumes that a keystore exists in
72     a directory 'keys'. To make a key accessible using the default
73     settings in the build.xml file then make the keys directory and add
74     the jarsigner key with the following :</p>
75   <pre>mkdir keys</pre>
76   <pre>keytool -genkey -keystore keys/.keystore -keypass alignmentisfun
77   -storepass alignmentisfun -sigalg SHA1withRSA -keyalg RSA -alias jalview</pre>
78   <em>(you will have to answer some personal questions here)</em>
79   <pre>ant makedist -DWebStartLocation="file://.pathtojalviewsource./dist" -Dapplication.codebase="*"</pre>
80   <p>This should eventually generate a jalview.jnlp file in ./dist
81     along with a set of signed jars using the jalview key). In order to
82     test locally via webstart you'll now need to add 'file:/' to your
83     java webstart security exception list. Then:</p>
84   <pre>javaws file://.pathtojalviewsource./dist/jalview.jnlp</pre>
85   <p>Please remember to remove that entry afterwards, since it will leave
86   your system vulnerable to malicious code.
87   </p>
88   <p>
89                 <strong>Building the JalviewLite applet<br>
90                 </strong> The JalviewLite applet is compiled using a subset of the packages in
91                 the src directory (specifically: MCView, and jalview.{datamodel,
92                 analysis, appletgui, utils, schemes, api, structure}, and
93                 com.stevesoft.*). Once compiled, these class files are obfuscated to
94                 make the code run efficiently. To compile the applet Jar, use the
95                 makeApplet task - optionally passing in a 'donotobfuscate' property to
96                 the ant build (e.g. -Ddonotobfuscate=true) to disable obfuscation. </p><p>
97                 The ant target 'pubapplet' can be used to compile install the
98                 jalviewApplet.jar and any dependent jars (under appletlib) into a copy
99                 of the examples directory created under the <em>outputDir</em> build
100                 property (which defaults to the 'dist' directory).
101         </p>
102         <p>
103 <h1>using IDEs to build Jalview</h1>
104         <p>The Jalview source distribution includes project definitions for
105                 Eclipse, Netbeans and some rather ancient Borland JBuilder .jpx
106                 project files. These files should be sufficient to set up basic source
107                 folders and build paths, but you will need to ensure that all .jar
108                 files in the lib and appletlib directories are added to the build path
109                 for your IDE project, and that the 'buildindices' target in Jalview's
110                 build.xml is executed with the 'outputDir' ant property set to the
111                 directory where the IDE expects to place compiled classes ('classes'
112                 directory for eclipse, 'build/classes' for netbeans).</p>
113         <p>Note: It is generally not recommended that you distribute build
114                 artefacts that were generated automatically via an IDE's own packaging
115                 mechanism (e.g. Netbeans' executable Jar and dependent lib directory).
116                 The hand-crafted ant build.xml is (currently) the only officially
117                 supported method of building distributable versions of Jalview.</p>
118         -->
119 <address>
120 <a href="mailto:help@jalview.org">Jalview development team</a>
121 </address>
122 </body>
123 </html>