JAL-3248 Added step to create the eclipse files before project import. Noted non...
[jalview.git] / doc / building.html
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3 <head>
4   <meta charset="utf-8" />
5   <meta name="generator" content="pandoc" />
6   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7   <title>Building Jalview from Source</title>
8   <style type="text/css">
9       code{white-space: pre-wrap;}
10       span.smallcaps{font-variant: small-caps;}
11       span.underline{text-decoration: underline;}
12       div.column{display: inline-block; vertical-align: top; width: 50%;}
13   </style>
14   <style type="text/css">
15 a.sourceLine { display: inline-block; line-height: 1.25; }
16 a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
17 a.sourceLine:empty { height: 1.2em; }
18 .sourceCode { overflow: visible; }
19 code.sourceCode { white-space: pre; position: relative; }
20 div.sourceCode { margin: 1em 0; }
21 pre.sourceCode { margin: 0; }
22 @media screen {
23 div.sourceCode { overflow: auto; }
24 }
25 @media print {
26 code.sourceCode { white-space: pre-wrap; }
27 a.sourceLine { text-indent: -1em; padding-left: 1em; }
28 }
29 pre.numberSource a.sourceLine
30   { position: relative; left: -4em; }
31 pre.numberSource a.sourceLine::before
32   { content: attr(title);
33     position: relative; left: -1em; text-align: right; vertical-align: baseline;
34     border: none; pointer-events: all; display: inline-block;
35     -webkit-touch-callout: none; -webkit-user-select: none;
36     -khtml-user-select: none; -moz-user-select: none;
37     -ms-user-select: none; user-select: none;
38     padding: 0 4px; width: 4em;
39     color: #aaaaaa;
40   }
41 pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
42 div.sourceCode
43   {  }
44 @media screen {
45 a.sourceLine::before { text-decoration: underline; }
46 }
47 code span.al { color: #ff0000; font-weight: bold; } /* Alert */
48 code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
49 code span.at { color: #7d9029; } /* Attribute */
50 code span.bn { color: #40a070; } /* BaseN */
51 code span.bu { } /* BuiltIn */
52 code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
53 code span.ch { color: #4070a0; } /* Char */
54 code span.cn { color: #880000; } /* Constant */
55 code span.co { color: #60a0b0; font-style: italic; } /* Comment */
56 code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
57 code span.do { color: #ba2121; font-style: italic; } /* Documentation */
58 code span.dt { color: #902000; } /* DataType */
59 code span.dv { color: #40a070; } /* DecVal */
60 code span.er { color: #ff0000; font-weight: bold; } /* Error */
61 code span.ex { } /* Extension */
62 code span.fl { color: #40a070; } /* Float */
63 code span.fu { color: #06287e; } /* Function */
64 code span.im { } /* Import */
65 code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
66 code span.kw { color: #007020; font-weight: bold; } /* Keyword */
67 code span.op { color: #666666; } /* Operator */
68 code span.ot { color: #007020; } /* Other */
69 code span.pp { color: #bc7a00; } /* Preprocessor */
70 code span.sc { color: #4070a0; } /* SpecialChar */
71 code span.ss { color: #bb6688; } /* SpecialString */
72 code span.st { color: #4070a0; } /* String */
73 code span.va { color: #19177c; } /* Variable */
74 code span.vs { color: #4070a0; } /* VerbatimString */
75 code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
76   </style>
77   <style>
78   @font-face {
79     font-family: octicons-link;
80     src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff');
81   }
82   
83   body {
84     -webkit-text-size-adjust: 100%;
85     text-size-adjust: 100%;
86     color: #333;
87     font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
88     font-size: 16px;
89     line-height: 1.6;
90     word-wrap: break-word;
91     width: 728px;
92     max-width: 99%;
93     box-sizing: border-box;
94     padding: 30px 30px 8rem 30px;
95     margin-left: auto;
96     margin-right: auto;
97   }
98   
99   body a {
100     background-color: transparent;
101   }
102   
103   body a:active,
104   body a:hover {
105     outline: 0;
106   }
107   
108   body strong {
109     font-weight: bold;
110   }
111   
112   body h1 {
113     font-size: 2em;
114     margin: 0.67em 0;
115   }
116   
117   body img {
118     border: 0;
119   }
120   
121   body hr {
122     box-sizing: content-box;
123     height: 0;
124   }
125   
126   body pre {
127     overflow: auto;
128   }
129   
130   body code,
131   body kbd,
132   body pre {
133     font-family: monospace, monospace;
134     font-size: 1em;
135   }
136   
137   body input {
138     color: inherit;
139     font: inherit;
140     margin: 0;
141   }
142   
143   body html input[disabled] {
144     cursor: default;
145   }
146   
147   body input {
148     line-height: normal;
149   }
150   
151   body input[type="checkbox"] {
152     box-sizing: border-box;
153     padding: 0;
154   }
155   
156   body table {
157     border-collapse: collapse;
158     border-spacing: 0;
159   }
160   
161   body td,
162   body th {
163     padding: 0;
164   }
165   
166   body * {
167     box-sizing: border-box;
168   }
169   
170   body input {
171     font: 13px / 1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
172   }
173   
174   body a {
175     color: #4078c0;
176     text-decoration: none;
177   }
178   
179   body a:hover,
180   body a:active {
181     text-decoration: underline;
182   }
183   
184   body hr {
185     height: 0;
186     margin: 15px 0;
187     overflow: hidden;
188     background: transparent;
189     border: 0;
190     border-bottom: 1px solid #ddd;
191   }
192   
193   body hr:before {
194     display: table;
195     content: "";
196   }
197   
198   body hr:after {
199     display: table;
200     clear: both;
201     content: "";
202   }
203   
204   body h1,
205   body h2,
206   body h3,
207   body h4,
208   body h5,
209   body h6 {
210     margin-top: 15px;
211     margin-bottom: 15px;
212     line-height: 1.1;
213   }
214   
215   body h1 {
216     font-size: 30px;
217   }
218   
219   body h2 {
220     font-size: 21px;
221   }
222   
223   body h3 {
224     font-size: 16px;
225   }
226   
227   body h4 {
228     font-size: 14px;
229   }
230   
231   body h5 {
232     font-size: 12px;
233   }
234   
235   body h6 {
236     font-size: 11px;
237   }
238   
239   body blockquote {
240     margin: 0;
241   }
242   
243   body ul,
244   body ol {
245     padding: 0;
246     margin-top: 0;
247     margin-bottom: 0;
248   }
249   
250   body ol ol,
251   body ul ol {
252     list-style-type: lower-roman;
253   }
254   
255   body ul ul ol,
256   body ul ol ol,
257   body ol ul ol,
258   body ol ol ol {
259     list-style-type: lower-alpha;
260   }
261   
262   body dd {
263     margin-left: 0;
264   }
265   
266   body code {
267     font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
268     font-size: 12px;
269   }
270   
271   body pre {
272     margin-top: 0;
273     margin-bottom: 0;
274     font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
275   }
276   
277   body .select::-ms-expand {
278     opacity: 0;
279   }
280   
281   body .octicon {
282     font: normal normal normal 16px/1 octicons-link;
283     display: inline-block;
284     text-decoration: none;
285     text-rendering: auto;
286     -webkit-font-smoothing: antialiased;
287     -moz-osx-font-smoothing: grayscale;
288     -webkit-user-select: none;
289     -moz-user-select: none;
290     -ms-user-select: none;
291     user-select: none;
292   }
293   
294   body .octicon-link:before {
295     content: '\f05c';
296   }
297   
298   body:before {
299     display: table;
300     content: "";
301   }
302   
303   body:after {
304     display: table;
305     clear: both;
306     content: "";
307   }
308   
309   body>*:first-child {
310     margin-top: 0 !important;
311   }
312   
313   body>*:last-child {
314     margin-bottom: 0 !important;
315   }
316   
317   body a:not([href]) {
318     color: inherit;
319     text-decoration: none;
320   }
321   
322   body .anchor {
323     display: inline-block;
324     padding-right: 2px;
325     margin-left: -18px;
326   }
327   
328   body .anchor:focus {
329     outline: none;
330   }
331   
332   body h1,
333   body h2,
334   body h3,
335   body h4,
336   body h5,
337   body h6 {
338     margin-top: 1em;
339     margin-bottom: 16px;
340     font-weight: bold;
341     line-height: 1.4;
342   }
343   
344   body h1 .octicon-link,
345   body h2 .octicon-link,
346   body h3 .octicon-link,
347   body h4 .octicon-link,
348   body h5 .octicon-link,
349   body h6 .octicon-link {
350     color: #000;
351     vertical-align: middle;
352     visibility: hidden;
353   }
354   
355   body h1:hover .anchor,
356   body h2:hover .anchor,
357   body h3:hover .anchor,
358   body h4:hover .anchor,
359   body h5:hover .anchor,
360   body h6:hover .anchor {
361     text-decoration: none;
362   }
363   
364   body h1:hover .anchor .octicon-link,
365   body h2:hover .anchor .octicon-link,
366   body h3:hover .anchor .octicon-link,
367   body h4:hover .anchor .octicon-link,
368   body h5:hover .anchor .octicon-link,
369   body h6:hover .anchor .octicon-link {
370     visibility: visible;
371   }
372   
373   body h1 {
374     padding-bottom: 0.3em;
375     font-size: 1.75em;
376     line-height: 1.2;
377   }
378   
379   body h1 .anchor {
380     line-height: 1;
381   }
382   
383   body h2 {
384     padding-bottom: 0.3em;
385     font-size: 1.5em;
386     line-height: 1.225;
387   }
388   
389   body h2 .anchor {
390     line-height: 1;
391   }
392   
393   body h3 {
394     font-size: 1.25em;
395     line-height: 1.43;
396   }
397   
398   body h3 .anchor {
399     line-height: 1.2;
400   }
401   
402   body h4 {
403     font-size: 1em;
404   }
405   
406   body h4 .anchor {
407     line-height: 1.2;
408   }
409   
410   body h5 {
411     font-size: 1em;
412   }
413   
414   body h5 .anchor {
415     line-height: 1.1;
416   }
417   
418   body h6 {
419     font-size: 1em;
420     color: #777;
421   }
422   
423   body h6 .anchor {
424     line-height: 1.1;
425   }
426   
427   body p,
428   body blockquote,
429   body ul,
430   body ol,
431   body dl,
432   body table,
433   body pre {
434     margin-top: 0;
435     margin-bottom: 16px;
436   }
437   
438   body hr {
439     height: 4px;
440     padding: 0;
441     margin: 16px 0;
442     background-color: #e7e7e7;
443     border: 0 none;
444   }
445   
446   body ul,
447   body ol {
448     padding-left: 2em;
449   }
450   
451   body ul ul,
452   body ul ol,
453   body ol ol,
454   body ol ul {
455     margin-top: 0;
456     margin-bottom: 0;
457   }
458   
459   body li>p {
460     margin-top: 16px;
461   }
462   
463   body dl {
464     padding: 0;
465   }
466   
467   body dl dt {
468     padding: 0;
469     margin-top: 16px;
470     font-size: 1em;
471     font-style: italic;
472     font-weight: bold;
473   }
474   
475   body dl dd {
476     padding: 0 16px;
477     margin-bottom: 16px;
478   }
479   
480   body blockquote {
481     padding: 0 15px;
482     color: #777;
483     border-left: 4px solid #ddd;
484   }
485   
486   body blockquote>:first-child {
487     margin-top: 0;
488   }
489   
490   body blockquote>:last-child {
491     margin-bottom: 0;
492   }
493   
494   body table {
495     display: block;
496     width: 100%;
497     overflow: auto;
498     word-break: normal;
499     word-break: keep-all;
500   }
501   
502   body table th {
503     font-weight: bold;
504   }
505   
506   body table th,
507   body table td {
508     padding: 6px 13px;
509     border: 1px solid #ddd;
510   }
511   
512   body table tr {
513     background-color: #fff;
514     border-top: 1px solid #ccc;
515   }
516   
517   body table tr:nth-child(2n) {
518     background-color: #f8f8f8;
519   }
520   
521   body img {
522     max-width: 100%;
523     box-sizing: content-box;
524     background-color: #fff;
525   }
526   
527   body code {
528     padding: 0;
529     padding-top: 0;
530     padding-bottom: 0;
531     margin: 0;
532     font-size: 85%;
533     background-color: rgba(0,0,0,0.04);
534     border-radius: 3px;
535   }
536   
537   body code:before,
538   body code:after {
539     letter-spacing: -0.2em;
540     content: "\00a0";
541   }
542   
543   body pre>code {
544     padding: 0;
545     margin: 0;
546     font-size: 100%;
547     word-break: normal;
548     white-space: pre;
549     background: transparent;
550     border: 0;
551   }
552   
553   body .highlight {
554     margin-bottom: 16px;
555   }
556   
557   body .highlight pre,
558   body pre {
559     padding: 16px;
560     overflow: auto;
561     font-size: 85%;
562     line-height: 1.45;
563     background-color: #f7f7f7;
564     border-radius: 3px;
565   }
566   
567   body .highlight pre {
568     margin-bottom: 0;
569     word-break: normal;
570   }
571   
572   body pre {
573     word-wrap: normal;
574   }
575   
576   body pre code {
577     display: inline;
578     max-width: initial;
579     padding: 0;
580     margin: 0;
581     overflow: initial;
582     line-height: inherit;
583     word-wrap: normal;
584     background-color: transparent;
585     border: 0;
586   }
587   
588   body pre code:before,
589   body pre code:after {
590     content: normal;
591   }
592   
593   body kbd {
594     display: inline-block;
595     padding: 3px 5px;
596     font-size: 11px;
597     line-height: 10px;
598     color: #555;
599     vertical-align: middle;
600     background-color: #fcfcfc;
601     border: solid 1px #ccc;
602     border-bottom-color: #bbb;
603     border-radius: 3px;
604     box-shadow: inset 0 -1px 0 #bbb;
605   }
606   
607   body .pl-c {
608     color: #969896;
609   }
610   
611   body .pl-c1,
612   body .pl-s .pl-v {
613     color: #0086b3;
614   }
615   
616   body .pl-e,
617   body .pl-en {
618     color: #795da3;
619   }
620   
621   body .pl-s .pl-s1,
622   body .pl-smi {
623     color: #333;
624   }
625   
626   body .pl-ent {
627     color: #63a35c;
628   }
629   
630   body .pl-k {
631     color: #a71d5d;
632   }
633   
634   body .pl-pds,
635   body .pl-s,
636   body .pl-s .pl-pse .pl-s1,
637   body .pl-sr,
638   body .pl-sr .pl-cce,
639   body .pl-sr .pl-sra,
640   body .pl-sr .pl-sre {
641     color: #183691;
642   }
643   
644   body .pl-v {
645     color: #ed6a43;
646   }
647   
648   body .pl-id {
649     color: #b52a1d;
650   }
651   
652   body .pl-ii {
653     background-color: #b52a1d;
654     color: #f8f8f8;
655   }
656   
657   body .pl-sr .pl-cce {
658     color: #63a35c;
659     font-weight: bold;
660   }
661   
662   body .pl-ml {
663     color: #693a17;
664   }
665   
666   body .pl-mh,
667   body .pl-mh .pl-en,
668   body .pl-ms {
669     color: #1d3e81;
670     font-weight: bold;
671   }
672   
673   body .pl-mq {
674     color: #008080;
675   }
676   
677   body .pl-mi {
678     color: #333;
679     font-style: italic;
680   }
681   
682   body .pl-mb {
683     color: #333;
684     font-weight: bold;
685   }
686   
687   body .pl-md {
688     background-color: #ffecec;
689     color: #bd2c00;
690   }
691   
692   body .pl-mi1 {
693     background-color: #eaffea;
694     color: #55a532;
695   }
696   
697   body .pl-mdr {
698     color: #795da3;
699     font-weight: bold;
700   }
701   
702   body .pl-mo {
703     color: #1d3e81;
704   }
705   
706   body kbd {
707     display: inline-block;
708     padding: 3px 5px;
709     font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
710     line-height: 10px;
711     color: #555;
712     vertical-align: middle;
713     background-color: #fcfcfc;
714     border: solid 1px #ccc;
715     border-bottom-color: #bbb;
716     border-radius: 3px;
717     box-shadow: inset 0 -1px 0 #bbb;
718   }
719   
720   body .task-list-item {
721     list-style-type: none;
722   }
723   
724   body .task-list-item+.task-list-item {
725     margin-top: 3px;
726   }
727   
728   body .task-list-item input {
729     margin: 0 0.35em 0.25em -1.6em;
730     vertical-align: middle;
731   }
732   
733   body :checked+.radio-label {
734     z-index: 1;
735     position: relative;
736     border-color: #4078c0;
737   }
738   </style>
739 </head>
740 <body>
741 <nav id="TOC">
742 <ul>
743 <li><a href="#building-jalview-from-source">Building Jalview from Source</a><ul>
744 <li><a href="#tldr">tl;dr</a></li>
745 <li><a href="#setting-up">Setting up</a><ul>
746 <li><a href="#java-11-compliant-jdk">Java 11 compliant JDK</a></li>
747 <li><a href="#gradle-and-git">gradle and git</a></li>
748 </ul></li>
749 <li><a href="#downloading-the-jalview-source-tree">Downloading the Jalview source tree</a><ul>
750 <li><a href="#whats-in-the-source-tree">What’s in the source tree?</a></li>
751 </ul></li>
752 <li><a href="#building-jalview">Building Jalview</a><ul>
753 <li><a href="#minimal-jalview-build">Minimal Jalview Build</a></li>
754 <li><a href="#jalview-in-a-jar-file">Jalview in a Jar File</a></li>
755 <li><a href="#distributed-jar-files">Distributed Jar Files</a></li>
756 <li><a href="#single-shadow-jar-file">Single <em>shadow</em> Jar File</a></li>
757 <li><a href="#building-the-getdown-launcher">Building the <code>getdown</code> launcher</a></li>
758 <li><a href="#running-tests">Running tests</a></li>
759 <li><a href="#installer-packaging-with-install4j">Installer packaging with <em>install4j</em></a></li>
760 </ul></li>
761 <li><a href="#gradle-properties">Gradle properties</a></li>
762 <li><a href="#enabling-code-coverage-with-openclover">Enabling Code Coverage with OpenClover</a></li>
763 <li><a href="#setting-up-in-eclipse-ide">Setting up in Eclipse IDE</a><ul>
764 <li><a href="#installing-eclipse-ide">Installing Eclipse IDE</a></li>
765 <li><a href="#importing-jalview-as-an-eclipse-project">Importing Jalview as an Eclipse project</a></li>
766 </ul></li>
767 </ul></li>
768 </ul>
769 </nav>
770 <h1 id="building-jalview-from-source">Building Jalview from Source</h1>
771 <h2 id="tldr">tl;dr</h2>
772 <pre><code># download
773 git clone http://source.jalview.org/git/jalview.git
774 # compile
775 cd jalview
776 gradle shadowJar
777 # run
778 java -jar build/libs/jalview-all-11.jar
779
780 # and/or create launcher
781 gradle getdown
782 # use launcher
783 cd getdown/files
784 java -jar getdown-launcher.jar . jalview</code></pre>
785 <h2 id="setting-up">Setting up</h2>
786 <blockquote>
787 <p>To get set up using <em>only</em> the Eclipse IDE (<a href="https://www.eclipse.org/" class="uri">https://www.eclipse.org/</a>) then please see the section <a href="#setting-up-in-eclipse-ide">Setting up in Eclipse IDE</a></p>
788 </blockquote>
789 <p>The method here is described in terms of using a command line. You can easily do this on linux or in a Terminal window in macOS. You can do it in Windows.</p>
790 <ul>
791 <li>Java 11 compliant JDK</li>
792 <li>gradle 5.2 or above <em>(NB gradle 6.6 and above currently produces NullPointerExceptions during the build. This is non-fatal and does not affect the build. Use gradle 6.5.1 to avoid this)</em></li>
793 <li>git</li>
794 </ul>
795 <blockquote>
796 <p>The versions and installation methods here are just suggestions (which we have tested so are known to work). If you need or wish to use different implementations (particularly you might need a bespoke JDK if you are on an exotic architecture) then the general build instructions should work with any gradle 5+. You should be able to compile the bytecode with any JDK Java 11+. The resulting bytecode (in particular the shadow jar) should be runnable in any JRE Java 1.8+. Remember that because Jalview and the getdown launcher are Java bytecode you can build on one system where you might have gradle, and run on another where you don’t (JRE 1.8+ required).</p>
797 </blockquote>
798 <h3 id="java-11-compliant-jdk">Java 11 compliant JDK</h3>
799 <h4 id="all-platforms">All platforms</h4>
800 <p>We recommend obtaining an OpenJDK JDK 11 (since 11 is the long term support release) from AdoptOpenJDK: <a href="https://adoptopenjdk.net/?variant=openjdk11&amp;jvmVariant=hotspot" class="uri">https://adoptopenjdk.net/?variant=openjdk11&amp;jvmVariant=hotspot</a>, either the <em>Installer</em> or <code>.zip</code>/<code>.tar.gz</code> variants whichever you prefer (if you’re not sure, choose the <em>Installer</em>).</p>
801 <blockquote>
802 <h5 id="alternativecli-install-of-adoptopenjdk-11">Alternative/CLI install of AdoptOpenJDK 11</h5>
803 <p>You can also install adoptopenjdk11 using either <code>brew</code> (macOS), <code>choco</code> (Windows) (see the section on <code>gradle</code> and <code>git</code> for more informaiton on <code>brew</code> and <code>choco</code>) or <code>yum</code> or <code>apt</code> (Linux):</p>
804 <h6 id="alternative-for-macos-and-homebrew">alternative for MacOS and Homebrew</h6>
805 <pre><code>brew tap adoptopenjdk/openjdk
806 brew cask install adoptopenjdk11</code></pre>
807 <h6 id="alternative-for-windows-and-chocolatey">alternative for Windows and Chocolatey</h6>
808 <pre><code>choco install adoptopenjdk11</code></pre>
809 <h6 id="alternative-for-linux-with-yumapt">alternative for Linux with yum/apt</h6>
810 <p>see <a href="https://adoptopenjdk.net/installation.html#linux-pkg" class="uri">https://adoptopenjdk.net/installation.html#linux-pkg</a></p>
811 </blockquote>
812 <h3 id="gradle-and-git">gradle and git</h3>
813 <p>You should be able to install the latest (or sufficiently recent) versions of gradle and git using your OS package manager.</p>
814 <h4 id="macos">MacOS</h4>
815 <p>we recommend using <code>brew</code>, which can be installed following the instructions at <a href="https://brew.sh/" class="uri">https://brew.sh/</a>. After installing <code>brew</code>, open a Terminal window and type in (using an Administrator privileged user):</p>
816 <div class="sourceCode" id="cb4"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb4-1" title="1"><span class="ex">brew</span> install gradle git</a></code></pre></div>
817 <p>or if you aready have them installed but need to upgrade the version:</p>
818 <div class="sourceCode" id="cb5"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb5-1" title="1"><span class="ex">brew</span> upgrade gradle git</a></code></pre></div>
819 <h4 id="windows">Windows</h4>
820 <p>we suggest using the <strong>Chocolatey</strong> package manager. See install instructions at <a href="https://chocolatey.org/" class="uri">https://chocolatey.org/</a>, and you will just need</p>
821 <div class="sourceCode" id="cb6"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb6-1" title="1"><span class="ex">choco</span> install gradle</a>
822 <a class="sourceLine" id="cb6-2" title="2"><span class="ex">choco</span> install git</a></code></pre></div>
823 <p>Alternatively, you could install a real <code>bash</code> shell and install both <code>gradle</code> and <code>git</code> through <code>apt-get</code>. See <a href="https://devblogs.microsoft.com/commandline/bash-on-ubuntu-on-windows-download-now-3/" class="uri">https://devblogs.microsoft.com/commandline/bash-on-ubuntu-on-windows-download-now-3/</a> for how to install the ubuntu bash shell in Windows 10.</p>
824 <p>Another alternative would be to install them separately. For <code>gradle</code> follow the instructions at <a href="https://gradle.org/install/" class="uri">https://gradle.org/install/</a>, and for <code>git</code> here are a couple of suggestions: Git for Windows <a href="https://gitforwindows.org/" class="uri">https://gitforwindows.org/</a>. Getting the individual installs working together on the command line will be trickier so we recommend using Chocolatey or bash.</p>
825 <h4 id="linux">Linux</h4>
826 <p>this will depend on which distribution you’re using.</p>
827 <h5 id="for-debian-based-distributions-e.g.-mint-ubuntu-debian">For <em>Debian</em> based distributions (e.g. Mint, Ubuntu, Debian)</h5>
828 <p>run</p>
829 <div class="sourceCode" id="cb7"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb7-1" title="1"> <span class="fu">sudo</span> apt-get install gradle git</a></code></pre></div>
830 <h5 id="for-rpm-based-distributions-e.g.-fedora-centos-redhat">for RPM-based distributions (e.g. Fedora, CentOS, RedHat)</h5>
831 <p>run</p>
832 <div class="sourceCode" id="cb8"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb8-1" title="1"><span class="fu">sudo</span> yum install gradle git</a></code></pre></div>
833 <p>If you have some other version of linux you’ll probably be able to work it out!</p>
834 <h2 id="downloading-the-jalview-source-tree">Downloading the Jalview source tree</h2>
835 <p>This can be done with <code>git</code>. On the command line, change directory to where you want to download Jalview’s build-tree top level directory. Then run</p>
836 <div class="sourceCode" id="cb9"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb9-1" title="1"><span class="fu">git</span> clone http://source.jalview.org/git/jalview.git</a></code></pre></div>
837 <p>You’ll get some progress output and after a minute or two you should have the full Jalview build-tree in the folder <code>jalview</code>.</p>
838 <h3 id="whats-in-the-source-tree">What’s in the source tree?</h3>
839 <p>Jalview is a mature product with its codebase going back many years. As such it doesn’t have a folder structure that most new gradle projects would have, so you might not find everything in the place you might expect. Here’s a brief description of what you might find in the main folders under the <code>jalview</code> tree.</p>
840 <p>Within the <code>jalview</code> folder you will find (of possible interest):</p>
841 <table>
842 <colgroup>
843 <col style="width: 15%" />
844 <col style="width: 84%" />
845 </colgroup>
846 <thead>
847 <tr class="header">
848 <th>dir/ or file</th>
849 <th>contains</th>
850 </tr>
851 </thead>
852 <tbody>
853 <tr class="odd">
854 <td><code>bin/</code></td>
855 <td>used by eclipse for compiled classes – no need to touch this</td>
856 </tr>
857 <tr class="even">
858 <td><code>build/</code></td>
859 <td>the gradle build dir</td>
860 </tr>
861 <tr class="odd">
862 <td><code>classes/</code></td>
863 <td>contains the compiled Java classes for the Jalview application</td>
864 </tr>
865 <tr class="even">
866 <td><code>dist/</code></td>
867 <td>assembled <code>.jar</code> files needed to run Jalview application</td>
868 </tr>
869 <tr class="odd">
870 <td><code>examples/</code></td>
871 <td>example input files usable by Jalview</td>
872 </tr>
873 <tr class="even">
874 <td><code>getdown/</code></td>
875 <td>the libraries used by the Javliew launcher (getdown)</td>
876 </tr>
877 <tr class="odd">
878 <td><code>getdown/src/</code></td>
879 <td>our modified source for <code>getdown</code></td>
880 </tr>
881 <tr class="even">
882 <td><code>getdown/website/</code></td>
883 <td>the assembled “download” folder used by getdown for downloads/upgrades</td>
884 </tr>
885 <tr class="odd">
886 <td><code>getdown/files/</code></td>
887 <td>the minimal fileset to launch the Jalview launcher, which can then download the rest of the Jalview application</td>
888 </tr>
889 <tr class="even">
890 <td><code>help/</code></td>
891 <td>the help documents</td>
892 </tr>
893 <tr class="odd">
894 <td><code>j8lib/</code></td>
895 <td>libraries needed to run Jalview under Java 1.8</td>
896 </tr>
897 <tr class="even">
898 <td><code>j11lib/</code></td>
899 <td>libraries needed to run Jalivew under Java 11</td>
900 </tr>
901 <tr class="odd">
902 <td><code>resource/</code></td>
903 <td>non-java resources used in the Jalview application</td>
904 </tr>
905 <tr class="even">
906 <td><code>src/</code></td>
907 <td>the Jalview application source <code>.java</code> files</td>
908 </tr>
909 <tr class="odd">
910 <td><code>test/</code></td>
911 <td>Test class source files</td>
912 </tr>
913 <tr class="even">
914 <td><code>utils/</code></td>
915 <td>helper applications used in the build process</td>
916 </tr>
917 <tr class="odd">
918 <td><code>utils/install4j/</code></td>
919 <td>files used by the packaging tool, install4j</td>
920 </tr>
921 <tr class="even">
922 <td><code>build.gradle</code></td>
923 <td>the build file used by gradle</td>
924 </tr>
925 <tr class="odd">
926 <td><code>gradle.properties</code></td>
927 <td>configurable properties for the build process</td>
928 </tr>
929 <tr class="even">
930 <td><code>RELEASE</code></td>
931 <td>propertyfile configuring JALVIEW_VERSION (from jalview.version) and the release branch (from jalview.release). An alternative file can be specified via JALVIEW_RELEASE_FILE property</td>
932 </tr>
933 </tbody>
934 </table>
935 <p>Note that you need a Java 11 JDK to compile Jalview whether your target build is Java 1.8 or Java 11.</p>
936 <h2 id="building-jalview">Building Jalview</h2>
937 <p>You will need to have the Java 11 <code>javac</code> in your path, or alternatively you can configure gradle to know where this is by putting</p>
938 <pre><code>org.gradle.java.home=/path_to_jdk_directory</code></pre>
939 <p>in the <code>gradle.properties</code> file.</p>
940 <blockquote>
941 <p><em>You may want to see some of the other properties you can change at the end of this document.</em></p>
942 </blockquote>
943 <h3 id="minimal-jalview-build">Minimal Jalview Build</h3>
944 <p>To compile the necessary class files, just run</p>
945 <div class="sourceCode" id="cb11"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb11-1" title="1"><span class="ex">gradle</span> compileJava</a></code></pre></div>
946 <p>to compile the classes into the <code>classes</code> folder. You should now be able to run the Jalview application directly with</p>
947 <div class="sourceCode" id="cb12"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb12-1" title="1"><span class="ex">java</span> -cp <span class="st">&quot;classes:resources:help:j11lib/*&quot;</span> jalview.bin.Jalview</a></code></pre></div>
948 <p>You can also run with an automatic large memory setting (which will set the maximum memory heap of the Jalview JVM to 90% of your local physical memory) and docked icon setting (if possible in your OS) with</p>
949 <div class="sourceCode" id="cb13"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb13-1" title="1"><span class="ex">java</span> -cp <span class="st">&quot;classes:resources:help:j11lib/*&quot;</span> jalview.bin.Launcher</a></code></pre></div>
950 <blockquote>
951 <p><em>You must use just “<code>j11lib/*</code>” and not “<code>j11lib/*.jar</code>” as this is a special Java classpath argument wildcard interpreted by <code>java</code>, <strong>not</strong> a shell expansion wildcard interpreted by the shell.</em></p>
952 </blockquote>
953 <p>Note that <code>jalview.bin.Launcher</code> is a simplified launcher class that re-launches <code>jalview.bin.Jalview</code> with the same JRE (<em>not</em> the same JVM instance), classpath and arguments, but with an automatically determined <code>-Xmx...</code> memory setting if one hasn’t been provided.</p>
954 <h3 id="jalview-in-a-jar-file">Jalview in a Jar File</h3>
955 <p>To package the <code>classes</code>, <code>resources</code>, and <code>help</code> into one jar, you can run</p>
956 <div class="sourceCode" id="cb14"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb14-1" title="1"><span class="ex">gradle</span> jar</a></code></pre></div>
957 <p>which assembles the Jalview classes and resources into <code>dist/jalview.jar</code></p>
958 <p>To run this, use</p>
959 <div class="sourceCode" id="cb15"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb15-1" title="1"><span class="ex">java</span> -cp <span class="st">&quot;dist/jalview.jar:j11lib/*&quot;</span> jalview.bin.Jalview</a></code></pre></div>
960 <h3 id="distributed-jar-files">Distributed Jar Files</h3>
961 <p>To simplify this, all required <code>.jar</code> files can be assembled into the <code>dist</code> folder using</p>
962 <div class="sourceCode" id="cb16"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb16-1" title="1"><span class="ex">gradle</span> makeDist</a></code></pre></div>
963 <p>which puts all required jar files into <code>dist</code> so you can run with</p>
964 <div class="sourceCode" id="cb17"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb17-1" title="1"><span class="ex">java</span> -cp <span class="st">&quot;dist/*&quot;</span> jalview.bin.Jalview</a></code></pre></div>
965 <h3 id="single-shadow-jar-file">Single <em>shadow</em> Jar File</h3>
966 <p>The shadow jar file is a single <code>.jar</code> that contains all required classes and resources from <code>jalview.jar</code> and all of the supporting libraries in <code>j11lib/*.jar</code> merged into one <code>.jar</code> archive file. A default launching class (<code>MAIN-CLASS: jalview.bin.Launcher</code>) is specified in the <code>.jar</code> manifest file (<code>META/MANIFEST.MF</code>) so a start class doesn’t need to be specified.</p>
967 <p>Build the shadow jar file in <code>build/lib/jalview-all-11.jar</code> with</p>
968 <div class="sourceCode" id="cb18"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb18-1" title="1"><span class="ex">gradle</span> shadowJar</a></code></pre></div>
969 <p>and run it with</p>
970 <div class="sourceCode" id="cb19"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb19-1" title="1"><span class="ex">java</span> -jar build/lib/jalview-all-11.jar</a></code></pre></div>
971 <p>Because no arguments are required, most OSes will associate a <code>.jar</code> file with the <code>java</code> application (if this has been installed through the OS and not just a local unzip) as a <code>-jar</code> argument so you may find you can launch <code>jalview-all-11.jar</code> just by double-clicking on it)!</p>
972 <blockquote>
973 <p>The <code>shadowJar</code> task is not a requirement for any other task, so to build the shadow jar file you must specify the <code>shadowJar</code> task.</p>
974 </blockquote>
975 <blockquote>
976 <p>The shadow jar file represents probably the simplest way to distribute the Jalview application to machines that already have a Java 11 installed, although without the many and compelling benefits of the <code>getdown</code> launcher.</p>
977 </blockquote>
978 <h3 id="building-the-getdown-launcher">Building the <code>getdown</code> launcher</h3>
979 <p>We have made significant customisations to the <code>getdown</code> launcher which you can find in <code>getdown/src/getdown</code>.</p>
980 <blockquote>
981 <p>You don’t need to build this afresh as the required <code>getdown-core.jar</code> and <code>getdown-launcher.jar</code> files are already distributed in <code>j11lib</code> and <code>getdown/lib</code> but if you want to, then you’ll need a working Maven and also a Java 8 JDK. Ensure the Java 8 <code>javac</code> is forefront in your path and do</p>
982 <div class="sourceCode" id="cb20"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb20-1" title="1"><span class="bu">cd</span> getdown/src/getdown</a>
983 <a class="sourceLine" id="cb20-2" title="2"><span class="ex">mvn</span> clean package -Dgetdown.host.whitelist=<span class="st">&quot;jalview.org,*.jalview.org&quot;</span></a></code></pre></div>
984 <p>and you will find the required <code>.jar</code> files in <code>core/target/getdown-core-XXX.jar</code> and <code>launcher/target/getdown-launcher-XXX.jar</code>. The <code>getdown-core.jar</code> should then be copied to all three of the <code>j8lib</code>, <code>j11lib</code> and <code>getdown/lib</code> folders, whilst the <code>getdown-launcher.jar</code> only needs to be copied to <code>getdown/lib</code>.</p>
985 <p>The <code>mvn</code> command should ideally include the <code>-Dgetdown.host.whitelist=*.jalview.org</code> setting. This, and the necessary file copying commands, can be found in <code>getdown/src/getdown/mvn_cmd</code>.</p>
986 </blockquote>
987 <p>To assemble Jalview with <code>getdown</code> use the following gradle task:</p>
988 <div class="sourceCode" id="cb21"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb21-1" title="1"><span class="ex">gradle</span> getdown</a></code></pre></div>
989 <p>This puts all the necessary files to launch Jalview with <code>getdown</code> into <code>getdown/website/11/</code>. This could be treated as the reference folder for <code>getdown</code>, which is where a getdown launcher will check to see if the Jalview application files it has are up to date, and download if they aren’t or it simply doesn’t have them.</p>
990 <p>A minimal getdown-launcher can be found in <code>getdown/files/11/</code> which checks its up-to-date status with (the absolute path to) <code>getdown/website/11/</code>.</p>
991 <p>This can be launched with</p>
992 <div class="sourceCode" id="cb22"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb22-1" title="1"><span class="ex">java</span> -jar getdown/files/11/getdown-launcher.jar getdown/files/11/ jalview</a></code></pre></div>
993 <blockquote>
994 <p>We’ve already met the <code>-jar file.jar</code> arguments. The next argument is the working folder for getdown, and the final argument, “<code>jalview</code>”, is a getdown application id (only “<code>jalview</code>” is defined here).</p>
995 </blockquote>
996 <p>The command line sequence for building and relocating the getdown artifacts can be executed as a script via <code>getdown/src/getdown/mvn_cmd</code>. Please make sure this script is kept up to date should the getdown build instructions change.</p>
997 <h3 id="running-tests">Running tests</h3>
998 <p>There are substantial tests written for Jalview that use TestNG, which you can run with</p>
999 <div class="sourceCode" id="cb23"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb23-1" title="1"><span class="ex">gradle</span> test</a></code></pre></div>
1000 <p>These normally take around 5 - 10 minutes to complete and outputs its full results into the <code>tests/</code> folder. A summary of results should appear in your console.</p>
1001 <p>You can run different defined groups of tests with</p>
1002 <div class="sourceCode" id="cb24"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb24-1" title="1"><span class="ex">gradle</span> test -PtestngGroups=Network</a></code></pre></div>
1003 <p>Available groups include Functional (default), Network, External.</p>
1004 <h4 id="excluding-some-tests">Excluding some tests</h4>
1005 <p>Some of Jalview’s Functional tests don’t pass reliably in all environments. We tag these tests with a group like ‘Not-bamboo’ to mark them for exclusion when we run tests as part of continuous integration.</p>
1006 <p>To exclude one or more groups of tests, add them as a comma separated list in testngExcludedGroups.</p>
1007 <div class="sourceCode" id="cb25"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb25-1" title="1"><span class="ex">gradle</span> test -PtestngExcludedGroups=Not-bamboo</a></code></pre></div>
1008 <h3 id="installer-packaging-with-install4j">Installer packaging with <em>install4j</em></h3>
1009 <p>Jalview is currently using <em>install4j</em> <a href="https://www.ej-technologies.com/products/install4j/overview.html" class="uri">https://www.ej-technologies.com/products/install4j/overview.html</a> as its installer packaging tool.</p>
1010 <p>If you have a licensed installation of <em>install4j</em> you can build Jalview installers by running</p>
1011 <div class="sourceCode" id="cb26"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb26-1" title="1"><span class="ex">gradle</span> installers</a></code></pre></div>
1012 <p>though you may need to fiddle with the <code>install4j</code> and <code>copyInstall4jTemplate</code> tasks in <code>build.gradle</code> file to point to your installation of <em>install4j</em> and also to bundled JREs if you want to bundle those into the installers.</p>
1013 <p>If you want more details, get in touch on our development mailing list <a href="mailto:jalview-dev@jalview.org" class="email">jalview-dev@jalview.org</a>. Sign up at <a href="http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev" class="uri">http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev</a>.</p>
1014 <h2 id="gradle-properties">Gradle properties</h2>
1015 <p>There are a lot of properties configured in <code>gradle.properties</code> which we strongly recommend being left as they are unless you have a specific problem with the build process.</p>
1016 <p>There are a few gradle properties you might want to set on the command line with the <code>-P</code> flag when building a version of Jalview with specific requirements:</p>
1017 <h4 id="java_version"><code>JAVA_VERSION</code></h4>
1018 <p>This changes the <em>target</em> java bytecode version &gt; NOTE that you will need to use a Java 11 (or greater) JDK Java compiler to build Jalview for any byte-code target version.</p>
1019 <p>Valid values are <code>11</code> and <code>1.8</code>.</p>
1020 <p>e.g.</p>
1021 <div class="sourceCode" id="cb27"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb27-1" title="1"><span class="ex">gradle</span> shadowJar -PJAVA_VERSION=1.8</a></code></pre></div>
1022 <p>When using <code>-PJAVA_VERSION=1.8</code> the libraries from <code>j8lib</code> (instead of <code>j11lib</code>) will be used in the compile<br />
1023 and runtime classpath and also used in the <code>makeDist</code> build step. Where a Java version of <code>11</code> is used in folder and file names, it will instead use <code>1.8</code>. Also if you are building installer packages with <em>install4j</em> the package builder will look for JRE 1.8 bundles to package in the installers.</p>
1024 <blockquote>
1025 <p>Note that continued development of Jalview will assume a Java 11+ runtime environment, the 2.11.0 release will run under a Java 1.8 JRE with a few minor features disabled.</p>
1026 </blockquote>
1027 <h4 id="channel"><code>CHANNEL</code></h4>
1028 <p>This changes the <code>appbase</code> setting in <code>getdown.txt</code> (<code>appbase</code> is where the getdown launcher looks to see if there’s an updated file) to point to a particular Jalview channel or some other appropriate place to look for required files. If the selected channel type requires the getdown <code>appbase</code> to be a local directory on the filesystem (instead of a website URL) then a modified version of the <code>getdown-launcher.jar</code> will be used to allow this. The two versions of the <code>getdown-launcher.jar</code> can be found in <code>getdown/lib</code>. Some other variables used in the build process might also be set differently depending on the value of <code>CHANNEL</code> to allow smooth operation of getdown in the given context.</p>
1029 <p>There are several values of <code>CHANNEL</code> that can be chosen, with a default of <code>LOCAL</code>. Here’s what they’re for and what they do:</p>
1030 <ul>
1031 <li><code>LOCAL</code>: This is for running the compiled application from the development directory. It will set
1032 <ul>
1033 <li><code>appbase</code> as <code>file://PATH/TO/YOUR/DEVELOPMENT/getdown/files/JAVA_VERSION</code> (e.g. <code>file://home/user/git/jalview/getdown/files/11</code>)</li>
1034 <li>application subdir as <code>alt</code></li>
1035 <li>Getdown launcher can use a <code>file://</code> scheme appbase.</li>
1036 </ul></li>
1037 <li><code>BUILD</code>: This is for creating an appbase channel on the build server by an automatic or manually started build. It will set
1038 <ul>
1039 <li><code>appbase</code> as <code>https://builds.jalview.org/browse/${bamboo_planKey}/latest/artifact/shared/getdown-channel/JAVA_VERSION</code> Note that bamboo_planKey should be set by the build plan with <code>-Pbamboo_planKey=${bamboo.planKey}</code></li>
1040 <li>application subdir as <code>alt</code></li>
1041 <li>Getdown launcher cannot use a <code>file://</code> scheme appbase.</li>
1042 </ul></li>
1043 <li><code>DEVELOP</code>: This is for creating a <code>develop</code> appbase channel on the main web server. This won’t become live until the actual getdown artefact is synced to the web server. It will set
1044 <ul>
1045 <li><code>appbase</code> as <code>http://www.jalview.org/getdown/develop/JAVA_VERSION</code></li>
1046 <li>application subdir as <code>alt</code></li>
1047 <li>Getdown launcher cannot use a <code>file://</code> scheme appbase.</li>
1048 </ul></li>
1049 <li><code>SCRATCH-NAME</code>: This is for creating a temporary scratch appbase channel on the main web server. This won’t become live until the actual getdown artefact is synced to the web server. This is meant for testing an over-the-air update without interfering with the live <code>release</code> or <code>develop</code> channels. The value of <code>NAME</code> can be any “word-character” [A-Za-z0-9_] It will set
1050 <ul>
1051 <li><code>appbase</code> as <code>http://www.jalview.org/getdown/SCRATCH-NAME/JAVA_VERSION</code></li>
1052 <li>application subdir as <code>alt</code></li>
1053 <li>Getdown launcher cannot use a <code>file://</code> scheme appbase.</li>
1054 </ul></li>
1055 <li><code>TEST-LOCAL</code>: Like <code>SCRATCH</code> but with a specific <code>test-local</code> channel name and a local filesystem appbase. This is meant for testing an over-the-air update on the local filesystem. An extra property <code>LOCALDIR</code> must be given (e.g. <code>-PLOCALDIR=/home/user/tmp/test</code>) It will set
1056 <ul>
1057 <li><code>appbase</code> as <code>file://${LOCALDIR}</code></li>
1058 <li>application subdir as <code>alt</code></li>
1059 <li>Getdown launcher can use a <code>file://</code> scheme appbase.</li>
1060 </ul></li>
1061 <li><code>TEST-RELEASE</code>: Like <code>SCRATCH</code> but with a specific <code>test-release</code> channel name. This won’t become live until the actual getdown artefact is synced to the web server. This is meant for testing an over-the-air update without interfering with the live <code>release</code> or <code>develop</code> channels. It will set
1062 <ul>
1063 <li><code>appbase</code> as <code>http://www.jalview.org/getdown/test-release/JAVA_VERSION</code></li>
1064 <li>application subdir as <code>alt</code></li>
1065 <li>Getdown launcher cannot use a <code>file://</code> scheme appbase.</li>
1066 </ul></li>
1067 <li><code>RELEASE</code>: This is for an actual release build, and will use an appbase on the main web server with the main <code>release</code> channel name. This won’t become live until the actual getdown artefact is synced to the web server. It will set
1068 <ul>
1069 <li><code>appbase</code> as <code>http://www.jalview.org/getdown/release/JAVA_VERSION</code></li>
1070 <li>application subdir as <code>release</code></li>
1071 <li>Getdown launcher cannot use a <code>file://</code> scheme appbase.</li>
1072 </ul></li>
1073 <li><code>ARCHIVE</code>: This is a helper to create a channel for a specific release version, and will use an appbase on the main web server with a specific <code>archive/JALVIEW_VERSION</code> channel name. This won’t become live until the actual getdown artefact is synced to the web server. You must also specify an <code>ARCHIVEDIR</code> property that points to an earlier version of Jalview with a <code>dist</code> directory containing the required jar files. This should create a getdown structure and digest with the older jar files. It will set
1074 <ul>
1075 <li><code>appbase</code> as <code>http://www.jalview.org/getdown/archive/JALVIEW_VERSION/JAVA_VERSION</code></li>
1076 <li>application subdir as <code>alt</code></li>
1077 <li>Getdown launcher cannot use a <code>file://</code> scheme appbase.</li>
1078 </ul></li>
1079 <li><code>ARCHIVELOCAL</code>: Like <code>ARCHIVE</code> but with a local filesystem appbase for local testing. You must also specify an <code>ARCHIVEDIR</code> property that points to an earlier version of Jalview with a <code>dist</code> directory containing the required jar files. This should create a getdown structure and digest with the older jar files. It will set
1080 <ul>
1081 <li><code>appbase</code> as <code>file://PATH/TO/YOUR/DEVELOPMENT/getdown/website/JAVA_VERSION</code> (where the old jars will have been copied and digested)</li>
1082 <li>application subdir as <code>alt</code></li>
1083 <li>Getdown launcher can use a <code>file://</code> scheme appbase.</li>
1084 </ul></li>
1085 </ul>
1086 <p>e.g.</p>
1087 <div class="sourceCode" id="cb28"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb28-1" title="1"><span class="ex">gradle</span> getdown -PCHANNEL=SCRATCH-my_test_version</a></code></pre></div>
1088 <h4 id="jalview_version-and-the-release-file">JALVIEW_VERSION and the RELEASE file</h4>
1089 <p>Any Jalview build will include the value of JALVIEW_VERSION in various places, including the ‘About’ and Jalview Desktop window title, and in filenames for the stand-alone executable jar. You can specify a custom version for a build via the JALVIEW_VERSION property, but for most situations, JALVIEW_VERSION will be automatically configured according to the value of the CHANNEL property, using the <code>jalview.version</code> property specified in the RELEASE file: - <code>CHANNEL=RELEASE</code> will set version to jalview.version - <code>CHANNEL=TEST or DEVELOP</code> will append ‘-test’ or ‘-develop’ to jalview.version</p>
1090 <p>It is also possible to specify a custom location for the RELEASE file via an optional JALVIEW_RELEASE_FILE property.</p>
1091 <h4 id="install4jmediatypes"><code>install4jMediaTypes</code></h4>
1092 <p>If you are building <em>install4j</em> installers (requires <em>install4j</em> to be installed) then this property specifies a comma-separated list of media types (i.e. platform specific installers) <em>install4j</em> should actually build.</p>
1093 <p>Currently the valid values are <code>linuxDeb</code>, <code>linuxRPM</code>, <code>macosArchive</code>, <code>unixArchive</code>, <code>unixInstaller</code>, <code>windows</code></p>
1094 <p>The default value is all of them.</p>
1095 <p>e.g.</p>
1096 <div class="sourceCode" id="cb29"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb29-1" title="1"><span class="ex">gradle</span> installers -PJAVA_VERSION=1.8 -Pinstall4jMediaTypes=macosArchive</a></code></pre></div>
1097 <p>To get an up-to-date list of possible values, you can run</p>
1098 <div class="sourceCode" id="cb30"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb30-1" title="1"><span class="fu">perl</span> -n -e <span class="st">&#39;m/^\s*&lt;(\w+)[^&gt;]*\bmediaFileName=/ &amp;&amp; print &quot;$1\n&quot;;&#39;</span> utils/install4j/install4j_template.install4j  <span class="kw">|</span> <span class="fu">sort</span> -u</a></code></pre></div>
1099 <p>in the <code>jalview</code> root folder.</p>
1100 <h2 id="enabling-code-coverage-with-openclover">Enabling Code Coverage with OpenClover</h2>
1101 <p>Bytecode instrumentation tasks are enabled by specifying ‘true’ (or just a non-whitespace non-numeric word) in the ‘clover’ property. This adds the ‘openclover’ plugin to the build script’s classpath, making it possible to track code execution during test which can be viewed as an HTML report published at build/reports/clover/index.html.</p>
1102 <p><code>gradle -Pclover=true test cloverReport</code></p>
1103 <h4 id="troubleshooting-report-generation">Troubleshooting report generation</h4>
1104 <p>The build forks a new JVM process to run the clover report generation tools (both XML and HTML reports are generated by default). The following properties can be used to specify additional options or adjust JVM memory settings. Default values for these options are:</p>
1105 <h5 id="jvm-memory-settings---increase-if-out-of-memory-errors-are-reported">JVM Memory settings - increase if out of memory errors are reported</h5>
1106 <p><code>cloverReportJVMHeap = 2g</code></p>
1107 <h5 id="dfile.encodingutf-8-is-an-essential-parameters-for-report-generation.-add-additional-ones-separated-by-a-space.">-Dfile.encoding=UTF-8 is an essential parameters for report generation. Add additional ones separated by a space.</h5>
1108 <p><code>cloverReportJVMArgs = -Dfile.encoding=UTF-8</code></p>
1109 <h5 id="add--v-to-debug-velocity-html-generation-errors-or--d-to-track-more-detailed-issues-with-the-coverage-database">Add -v to debug velocity html generation errors, or -d to track more detailed issues with the coverage database</h5>
1110 <p><code>cloverReportHTMLOptions =</code></p>
1111 <h5 id="v-for-verbose--d-for-debug-level-messages-as-above">-v for verbose, -d for debug level messages (as above)</h5>
1112 <p><code>cloverReportXMLOptions =</code></p>
1113 <p><em>Note</em> do not forget to include the -Dfile.encoding=UTF-8 option: this is essential for some platforms in order for Clover to correctly parse some Jalview source files that contain characters that are UTF-8 encoded.</p>
1114 <h2 id="setting-up-in-eclipse-ide">Setting up in Eclipse IDE</h2>
1115 <h3 id="installing-eclipse-ide">Installing Eclipse IDE</h3>
1116 <p>We develop in Eclipse, and support settings to develop and save Jalview source code in our preferred style. We also support running the Jalview application, debugging and running tests with TestNG from within Eclipse.</p>
1117 <p>To get Jalview set up as a project in Eclipse, we recommend using at least the 2020-03 version of Eclipse IDE for Java Developers which you can download from the Eclipse website: <a href="https://www.eclipse.org/downloads/" class="uri">https://www.eclipse.org/downloads/</a>. Since Eclipse 2020-03 you are encouraged to use the Eclipse Installer (see the Eclipse Downloads page). In the installer, when given a choice of packages for Eclipse you should choose the “Eclipse IDE for Enterprise Java Developers” package.</p>
1118 <p><img src="./images/eclipse_installer.png" title="Eclipse Installer screenshot" /></p>
1119 <p>Once Eclipse is installed, we also recommend installing several plugins from the Eclipse Marketplace.</p>
1120 <p>Some of these should already be installed with the Enterprise Java Developer package:</p>
1121 <ol type="1">
1122 <li>Buildship Gradle Integration 3.0 (or greater)</li>
1123 <li>EclEmma Java Code Coverage</li>
1124 <li>Egit - Git Integration for Eclipse</li>
1125 </ol>
1126 <p>To install the others, launch Eclipse, and go to Help-&gt;Eclipse Marketplace…</p>
1127 <p>Search for and install:</p>
1128 <ol type="1">
1129 <li>Groovy Development Tools 3.4.0 (or greater)</li>
1130 <li>Checkstyle Plug-in (optional)</li>
1131 <li>TestNG for Eclipse (optional – only needed if you want to run tests from Eclipse)</li>
1132 </ol>
1133 <blockquote>
1134 <p>At time of writing, TestNG for Eclipse does not show up in the Eclipse Marketplace as the latest released version does not install in Eclipse 2020-03. However, you can install a working release of TestNG for Eclipse by going to</p>
1135 <p>Help-&gt;Install New Software…</p>
1136 <p>and entering</p>
1137 <p><code>TestNG Release - https://dl.bintray.com/testng-team/testng-eclipse-release</code></p>
1138 <p>into the <em>Work with</em> box and click on the <em>Add…</em> button.</p>
1139 <p>Eclipse might pause for a bit with the word <em>Pending</em> in the table below at this point, but it will eventually list TestNG with a selection box under the <em>Name</em> column.</p>
1140 <p>Select <em>TestNG</em> and carry on through the install process to install the TestNG plugin.</p>
1141 </blockquote>
1142 <p>After installing the plugins, check that Java 11 is set up in Eclipse as the default JRE (see section <a href="#java-11-compliant-jdk">Java 11 compliant JDK</a>).</p>
1143 <p>To do this go to Preferences (Eclipse-&gt;Preferences in macOS, File-&gt;Preferences on Windows or Window-&gt;Preferences on Linux) and find</p>
1144 <p>Java -&gt; Installed JREs</p>
1145 <p>If your Java 11 installation is not listed, click on</p>
1146 <p><em>Add</em> -&gt; Standard VM -&gt; <em>Next</em></p>
1147 <p>and enter the JRE home. You can browse to where it is installed. Give it a name (like “AdoptOpenJDK 11”). Select this JDK as the default JRE and click on <em>Apply and Close</em>.</p>
1148 <p>You can now import Jalview.</p>
1149 <h3 id="importing-jalview-as-an-eclipse-project">Importing Jalview as an Eclipse project</h3>
1150 <h4 id="importing-an-already-downloaded-git-repo">Importing an already downloaded git repo</h4>
1151 <p>If you have already downloaded Jalview using <code>git clone</code> then you can import this folder into Eclipse directly.</p>
1152 <p><strong>Before importing the cloned git repo you must create the Eclipse project files.</strong> You can do this by either running</p>
1153 <p><code>gradle eclipse</code></p>
1154 <p>or</p>
1155 <p>Unzipping the file <code>utils/eclipse/eclipse_startup_files.zip</code> in the base repo directory (<code>jalview</code>)</p>
1156 <p>It is important to import Jalview as a Gradle project (not as a Java project), so go to</p>
1157 <p>File-&gt;Import…</p>
1158 <p>find and select</p>
1159 <p>Gradle-&gt;Existing Gradle Project</p>
1160 <p>and then click on the <em>Next</em> button.</p>
1161 <p>In the following options, it is the <strong>Project Root Directory</strong> you should set to be the <code>jalview</code> folder that git downloaded. Then you can click on the <em>Finish</em> button.</p>
1162 <h4 id="using-eclipse-ide-to-download-the-git-repo">Using Eclipse IDE to download the git repo</h4>
1163 <p>If you don’t have git as a command line tool or would prefer to work entirely within Eclipse IDE then Eclipse’s eGit plugin can set up a git repo of the jalview source. Go to</p>
1164 <p>File-&gt;Import…</p>
1165 <p>Find and select</p>
1166 <p>Git-&gt;Projects from Git</p>
1167 <p>and then click on the <em>Next</em> button.</p>
1168 <p>Then select Clone URI and click on <em>Next</em>.</p>
1169 <p>In the next window (Source Git Repository) you should put the <code>git clone</code> URL in the text box labelled <code>URI</code>. If you have a Jalview developer account (with a username and password for the Jalview git repository) then you should enter <code>https://source.jalview.org/git/jalview.git</code>. If you do not have a Jalview developer account then you should enter <code>http://source.jalview.org/git/jalview.git</code>. You will not be able to push any of your changes back to the Jalview git repository. However you can still pull all branches of the Jalview source code to your computer and develop the code there. &gt; You can sign up for a Jalview developer account at <a href="https://source.jalview.org/crucible/" class="uri">https://source.jalview.org/crucible/</a></p>
1170 <p>If you have a Jalview developer account, enter the username and password and decide if you want to use Eclipse’s secure storage. If you don’t have an account you can leave the Authentication section blank.</p>
1171 <figure>
1172 <img src="./images/eclipse_egit_connection.png" alt="Eclipse eGit connection configuration" /><figcaption>Eclipse eGit connection configuration</figcaption>
1173 </figure>
1174 <p>Click on the <em>Next</em> button.</p>
1175 <p>The next window (Branch Selection) gives a list of the many Jalview branches, which by default will be all checked. You probably only want to download one branch (you can always download others at a later time). This is likely to be the <code>develop</code> branch so you can click on the <em>Deselect All</em> button, find the <code>develop</code> branch (the filter text helps), select that, and then click on the <em>Next</em> button.</p>
1176 <p>Choose a directory to your copy of the git repo in, and leave the other options as they are and click on the <em>Next</em> button. The next stage may take a minute or two as it checks out the selected branch(es) from the Jalview git repository.</p>
1177 <p>When it has finished it is important to select <strong>Import as general project</strong> and then click on <em>Next</em>. &gt; Ideally there would be an <em>Import as gradle project</em> here but there isn’t – we’ll sort that out later.</p>
1178 <figure>
1179 <img src="./images/eclipse_egit_import.png" alt="Eclipse eGit import choice" /><figcaption>Eclipse eGit import choice</figcaption>
1180 </figure>
1181 <p>Click on the <em>Next</em> button.</p>
1182 <p>You can change the project name here. By default it will show as <strong>jalview</strong> which is fine unless you have another instance of the a Jalview project also called jalview, in which case you could change this project’s name now to avoid a conflict within Eclipse.</p>
1183 <p>Click on <em>Finish</em>!</p>
1184 <p>However, we haven’t finished…</p>
1185 <p>You should now see, and be able to expand, the jalview project in the Project Explorer. We need to tell eclipse that this is a Gradle project, which will then allow the Eclipse Buildship plugin to automatically configure almost everything else!</p>
1186 <p>Right click on the project name (jalview) in the Project Explorer and find Configure towards the bottom of this long context menu, then choose Add Gradle Nature.</p>
1187 <figure>
1188 <img src="./images/eclipse_add_gradle_nature.png" alt="Eclipse Add Gradle Nature" /><figcaption>Eclipse Add Gradle Nature</figcaption>
1189 </figure>
1190 <p>The project should now reconfigure itself using the <code>build.gradle</code> file to dynamically set various aspects of the project including classpath.</p>
1191 <h4 id="additional-views">Additional views</h4>
1192 <p>Some views that are automatically added when Importing a Gradle Project are not added when simply Adding a Gradle Nature, but we can add these manually by clicking on Window-&gt;Show View-&gt;Console and Window-&gt;Show View-&gt;Other… Filter with the word “gradle” and choose both <strong>Gradle Executions</strong> and <strong>Gradle Tasks</strong> and then click on the <em>Open</em> button.</p>
1193 <p>Okay, ready to code! Use of Eclipse is beyond the scope of this document, but you can find more information about developing jalview and our developer workflow in the google doc <a href="https://docs.google.com/document/d/1lZo_pZRkazDBJGNachXr6qCVlw8ByuMYG6e9SZlPUlQ/edit?usp=sharing" class="uri">https://docs.google.com/document/d/1lZo_pZRkazDBJGNachXr6qCVlw8ByuMYG6e9SZlPUlQ/edit?usp=sharing</a></p>
1194 <hr />
1195 <p><a href="mailto:help@jalview.org">Jalview Development Team</a></p>
1196 </body>
1197 </html>