X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=doc%2Fbuilding.html;h=cc5eb30940179f1425e91ac377f66c15d36ba607;hb=d603dfa09e451bde0b376798f68d60c2708dd2b8;hp=f5e0b2896615eca8bd0437aa20d0d174c35c283f;hpb=1bd2350fdb5cce781548ce2e2188ab14bd412b6d;p=jalview.git diff --git a/doc/building.html b/doc/building.html old mode 100755 new mode 100644 index f5e0b28..cc5eb30 --- a/doc/building.html +++ b/doc/building.html @@ -1,123 +1,1160 @@ - - + + -Building Jalview from Source + + + + Building Jalview from Source + + + -

Building Jalview from Source

-

- -

-You will need the following:
+

-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 jalview directory and run gradle getdown. -

- -

Obtaining Jalview

-

This is easiest achieved with git: -

git clone http://www.jalview.org/git/jalview.git
-Then you can cd jalview to get into the top level jalview dir. - - -

-

Minimal Jalview build

-

To run Jalview, you just need the jalview classes and the .jar libraries that Jalview depends on.

- +
+

Building Jalview from Source

+

tl;dr

+
# download
+git clone http://source.jalview.org/git/jalview.git
+# compile
+cd jalview
+gradle shadowJar
+# run
+java -jar build/libs/jalview-all-11.jar
 
-
-
-Jalview development team -
+ +

Once Eclipse is installed, we also recommend installing several plugins from the Eclipse Marketplace.

+

Some of these should already be installed with the Enterprise Java Developer package:

+
    +
  1. Buildship Gradle Integration 3.0 (or greater)
  2. +
  3. EclEmma Java Code Coverage
  4. +
  5. Egit - Git Integration for Eclipse
  6. +
+

To install the others, launch Eclipse, and go to Help->Eclipse Marketplace...

+

Search for and install:

+
    +
  1. Groovy Development Tools 3.4.0 (or greater)
  2. +
  3. Checkstyle Plug-in (optional)
  4. +
  5. TestNG for Eclipse (optional -- only needed if you want to run tests from Eclipse)
  6. +
+
+

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 2019-03. However, you can install a working release of TestNG for Eclipse by going to

+

Help->Install New Software...

+

and entering

+

TestNG Release - https://dl.bintray.com/testng-team/testng-eclipse-release

+

into the Work with box and click on the Add... button.

+

Eclipse might pause for a bit with the word Pending in the table below at this point, but it will eventually list TestNG with a selection box under the Name column.

+

Select TestNG and carry on through the install process to install the TestNG plugin.

+
+

After installing the plugins, check that Java 11 is set up in Eclipse as the default JRE (see section Java 11 compliant JDK).

+

To do this go to Preferences (Eclipse->Preferences in macOS, File->Preferences on Windows or Window->Preferences on Linux) and find

+

Java -> Installed JREs

+

If your Java 11 installation is not listed, click on

+

Add -> Standard VM -> Next

+

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 Apply and Close.

+

You can now import Jalview.

+

Importing Jalview as an Eclipse project

+

Importing an already downloaded git repo

+

If you have already downloaded Jalview using git clone then you can import this folder into Eclipse directly.

+

It is important to import Jalview as a Gradle project (not as a Java project), so go to

+

File->Import...

+

find and select

+

Gradle->Existing Gradle Project

+

and then click on the Next button.

+

In the following options, it is the Project Root Directory you should set to be the jalview folder that git downloaded. Then you can click on the Finish button.

+

Using Eclipse IDE to download the git repo

+

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

+

File->Import...

+

Find and select

+

Git->Projects from Git

+

and then click on the Next button.

+

Then select Clone URI and click on Next.

+

In the next window (Source Git Repository) you should put the git clone URL in the text box labelled URI. If you have a Jalview developer account (with a username and password for the Jalview git repository) then you should enter https://source.jalview.org/git/jalview.git. If you do not have a Jalview developer account then you should enter http://source.jalview.org/git/jalview.git. 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. > You can sign up for a Jalview developer account at https://source.jalview.org/crucible/

+

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.

+
+Eclipse eGit connection configuration +

Eclipse eGit connection configuration

+
+

Click on the Next button.

+

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 develop branch so you can click on the Deselect All button, find the develop branch (the filter text helps), select that, and then click on the Next button.

+

Choose a directory to your copy of the git repo in, and leave the other options as they are and click on the Next button. The next stage may take a minute or two as it checks out the selected branch(es) from the Jalview git repository.

+

When it has finished it is important to select Import as general project and then click on Next. > Ideally there would be an Import as gradle project here but there isn't -- we'll sort that out later.

+
+Eclipse eGit import choice +

Eclipse eGit import choice

+
+

Click on the Next button.

+

You can change the project name here. By default it will show as jalview 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.

+

Click on Finish!

+

However, we haven't finished...

+

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!

+

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.

+
+Eclipse Add Gradle Nature +

Eclipse Add Gradle Nature

+
+

The project should now reconfigure itself using the build.gradle file to dynamically set various aspects of the project including classpath.

+

Additional views

+

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->Show View->Console and Window->Show View->Other... Filter with the word "gradle" and choose both Gradle Executions and Gradle Tasks and then click on the Open button.

+

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 https://docs.google.com/document/d/1lZo_pZRkazDBJGNachXr6qCVlw8ByuMYG6e9SZlPUlQ/edit?usp=sharing

+
+

Jalview Development Team