|  | 
|  | 1 | +# Building the GUI | 
|  | 2 | + | 
|  | 3 | +:::{important} | 
|  | 4 | +Before following this guide, ensure you have completed the following steps from | 
|  | 5 | +[the first-time installation guide](/overview/First-Time-Build): | 
|  | 6 | +- [Install Java JDK](#first_time_install_java) | 
|  | 7 | +- [Install Maven](#first_time_install_maven) | 
|  | 8 | +- [Install Git](#first_time_install_git) | 
|  | 9 | +- [Install Python (Uktena)](#first_time_install_uktena) | 
|  | 10 | +::: | 
|  | 11 | + | 
|  | 12 | +{#gui_build_checkout_code} | 
|  | 13 | +## Checking out the code | 
|  | 14 | + | 
|  | 15 | +Development builds of the IBEX GUI are conventionally located in `c:\instrument\dev`. Create this folder if it | 
|  | 16 | +doesn't already exist. | 
|  | 17 | + | 
|  | 18 | +From a windows command prompt, navigate to `c:\instrument\dev` and run: | 
|  | 19 | + | 
|  | 20 | +``` | 
|  | 21 | +git clone --recursive https://github.com/ISISComputingGroup/ibex_gui.git | 
|  | 22 | +``` | 
|  | 23 | + | 
|  | 24 | +The code for the IBEX GUI will now be located in `c:\instrument\dev\ibex_gui`. | 
|  | 25 | + | 
|  | 26 | +A [pre-commit hook](https://github.com/ISISComputingGroup/IBEX/issues/4786) should now be installed; to do this, run: | 
|  | 27 | + | 
|  | 28 | +``` | 
|  | 29 | +cd c:\instrument\dev\ibex_gui\build | 
|  | 30 | +install_pre_commit_hook.bat | 
|  | 31 | +``` | 
|  | 32 | + | 
|  | 33 | +{#gui_build_install_eclipse} | 
|  | 34 | +## Installing Eclipse | 
|  | 35 | + | 
|  | 36 | +You must use a version of eclipse which supports the RCP and Java versions currently in use by the client. There are | 
|  | 37 | +two options for this: | 
|  | 38 | +- Use the most recent version in `\\isis\inst$\Kits$\CompGroup\ICP\Developer Tools` | 
|  | 39 | +- Download a recent Eclipse version directly from | 
|  | 40 | +[the eclipse website](https://www.eclipse.org/downloads/packages/); choose the package for "RCP and RAP developers" | 
|  | 41 | + | 
|  | 42 | +By convention eclipse versions are installed into `c:\tools`, for example in  | 
|  | 43 | +`c:\tools\eclipse-rcp-2024-06-R-win32-x86_64`. | 
|  | 44 | + | 
|  | 45 | +After installing eclipse from either of the above sources, you will need to add the line | 
|  | 46 | +``` | 
|  | 47 | +-Djdk.util.zip.disableZip64ExtraFieldValidation=true | 
|  | 48 | +```  | 
|  | 49 | +to the end of `eclipse.ini` (located next to the `eclipse.exe` executable), if it is not already present. | 
|  | 50 | + | 
|  | 51 | +{#gui_build_via_eclipse} | 
|  | 52 | +## Building in Eclipse | 
|  | 53 | + | 
|  | 54 | +The first time the Eclipse IDE is started, it will ask you for a folder to use as a workspace.  | 
|  | 55 | +Unless you have a specific reason to choose a different location, use `c:\Instrument\dev\eclipse_workspaces\ibex_gui`  | 
|  | 56 | +(create this folder if it doesn't already exist). | 
|  | 57 | + | 
|  | 58 | + | 
|  | 59 | + | 
|  | 60 | +From the menu bar choose File -> Import -> General -> Existing Projects into Workspace. | 
|  | 61 | +Choose "Select root directory" and browse to `c:\Instrument\dev\ibex_gui\base`. You should now see a list of plugins  | 
|  | 62 | +to import with names like `uk.ac.stfc.isis.ibex.*`. Eclipse should automatically select everything so you just need  | 
|  | 63 | +to click "Finish" to add them to the project.  | 
|  | 64 | + | 
|  | 65 | +:::{tip} | 
|  | 66 | +If "Marketplace solutions available" dialogues appear, click cancel as these will be obtained later. | 
|  | 67 | +::: | 
|  | 68 | + | 
|  | 69 | +<img src="eclipse_import_ibex_gui.png" width=400> | 
|  | 70 | + | 
|  | 71 | +From the "Project Explorer" tab on the left, expand the target platform folder (labelled as  | 
|  | 72 | +`uk.ac.stfc.isis.ibex.targetplatform`), double click on the `targetplatform.target` file and choose  | 
|  | 73 | +"Set as Active Target Platform". This may take some time as dependencies are downloaded - there is a progress bar | 
|  | 74 | +in the very bottom-right of the Eclipse IDE. | 
|  | 75 | + | 
|  | 76 | +Once the target platform has finished downloading, the target platform view should look like this: | 
|  | 77 | + | 
|  | 78 | +<img src="eclipse_target_platform_view.png" width=600> | 
|  | 79 | + | 
|  | 80 | +To run the application from within Eclipse: open `ibex.product` from the `uk.ac.stfc.isis.ibex.e4.client.product` | 
|  | 81 | +folder, select "Launch an Eclipse application". The IBEX GUI should now open. | 
|  | 82 | + | 
|  | 83 | +Next, From the menu bar choose Run->Run configurations and select `ibex.product` from the left hand list under  | 
|  | 84 | +"Eclipse Application". In the "Main" tab, in **Run configurations**, tick the "Clear" tick box and untick the  | 
|  | 85 | +"Ask for confirmation before clearing". | 
|  | 86 | + | 
|  | 87 | +<img src="eclipse_clear_workspace.png" width=400> | 
|  | 88 | + | 
|  | 89 | +In the "Configuration" tab tick the "Clear the configuration area before launching" tick box.  | 
|  | 90 | +Click "Apply" and select "Run". | 
|  | 91 | + | 
|  | 92 | +:::{tip} | 
|  | 93 | +If you see a `java.lang.UnsupportedClassVersionError` error: | 
|  | 94 | +- Select Window -> Preferences -> Java -> Compiler | 
|  | 95 | +- Set compliance level to 21. | 
|  | 96 | +::: | 
|  | 97 | + | 
|  | 98 | +:::{tip} | 
|  | 99 | +If you see a "Plugin execution not covered by lifecycle configuration" error: | 
|  | 100 | +- From the menu bar choose: Window -> Preferences -> Maven -> Errors/Warnings | 
|  | 101 | +- Set "Plugin execution not covered by lifecycle configuration" to Ignore | 
|  | 102 | +::: | 
|  | 103 | + | 
|  | 104 | +Lastly, you should [set up checkstyle](../eclipse/Checkstyle-setup). | 
|  | 105 | + | 
|  | 106 | +If you did not manage to build or launch the IBEX client using these steps, there are troubleshooting notes for eclipse | 
|  | 107 | +[here](../eclipse/Common-Eclipse-Issues) and for the GUI in general [here](../GUI-Troubleshooting). | 
|  | 108 | + | 
|  | 109 | +{#gui_build_via_maven} | 
|  | 110 | +## Building via Maven | 
|  | 111 | + | 
|  | 112 | +Firstly, ensure you have a recent Maven version installed. Generally a suitable version will be the highest version | 
|  | 113 | +number in `\\isis\inst$\Kits$\CompGroup\ICP\Binaries`. You can double-check your current Maven version by running | 
|  | 114 | +`mvn -v` in a command prompt. | 
|  | 115 | + | 
|  | 116 | +To build using Maven, run: | 
|  | 117 | + | 
|  | 118 | +``` | 
|  | 119 | +cd c:\Instrument\dev\ibex_gui\build | 
|  | 120 | +build.bat | 
|  | 121 | +``` | 
|  | 122 | + | 
|  | 123 | +Once the build finishes, the IBEX client executable can be found in `.\built_client\`. | 
0 commit comments