Before you install Eclipse you may wish to consider whether or not you want to maintain separated Eclipse configurations and instances. Why would you do that? Well, it's perfectly possible for different IDE plugins to disagree with each other. So if you put a lot of work into configuring an IDE for an important project, you may want a separate IDE install for messing around with MapTool ;) If you are only installing Eclipse for MapTool, it doesn't matter. You can run multiple configurations from one Eclipse install directory or separate ones if you want. But each configuration should have its own workspace. This is because Eclipse does store some configuration data in the workspace folder.
I would also recommend specifying exactly which version of Java is used to run Eclipse (the JVM). If you don't, the current default version will be used, which is often the last one you installed. If you decided to install an older version, this can get annoying. So I always tell Eclipse exactly which version to use, leaving no surprises. The version of Java used to run Eclipse is separate from the version used to run any of your projects, so there is no real reason not to use the latest for your MapTool IDE.
- Go to the Eclipse Downloads Page
- Download the Eclipse IDE for Java EE Developers not the basic Eclipse IDE for Java Developers (grab the 64-bit or 32-bit as appropriate; the web page should determine that for you and emphasize the correct one). At the time of writing the latest build is Oxygen.
- Specify a directory to store your Eclipse configuration. You can choose the default unless you want to install multiple versions of Eclipse and keep them separate.
- Decide where you want to install Eclipse. It can be installed in any directory, but each operating system has its own set of preferences:
- for Windows, it is typically
C:\Program Files\eclipse
- for Linux, it is often
/opt/eclipse
- for macOS, it is
/Applications
- for Windows, it is typically
- Create a shortcut for Eclipse, if you wish.
- for Linux and macOS, copy the
eclipse
script in the install directory to your desktop (typically~/Desktop
) - for Windows:
- Copy the
eclipse.exe
file from your Eclipse directory and paste it as a shortcut onto your desktop, - Create a new top-level folder to hold your Eclipse configuration (previous step) and your Workspace (where projects will be stored by default). For example, use
C:\Data
and then put your Eclipse configuration in that directory as well as your Workspace directory. So my config directory isC:\Data\.eclipse
and my workspace folder isC:\Data\Workspace
. (Windows will not let you begin a folder name with a period, so create the folder under some other name and then drop to the command line to rename it.) - Right-click your Eclipse shortcut, click Properties and edit the Target line. Add
-configuration C:\Data\.eclipse
where the path matches the directory you created in the last step. If the path contains spaces, you can surround it in double quotes.
- Copy the
- for Linux and macOS, copy the
- Specify the Eclipse JVM (in the examples below, replace
JAVA_HOME
with wherever you installed Java).- Determine where your Java executable is stored.
- for Windows, this is
JAVA_HOME\bin\javaw.exe
- for Linux and macOS, this is
JAVA_HOME\bin\java
- for Windows, this is
- Open the Eclipse directory (such as
C:\Program Files\eclipse
on Windows or/Applications/Eclipse.app/Contents/Eclipse/
on macOS) and edit theeclipse.ini
file. Add the lines below, where the path matches your newest Java release. (If there's already a line containing-vm
, just replace the following line.)-vm JAVA_HOME\bin\javaw.exe
- For example, the file might contain this on Windows:
-vm C:\Program Files\Java\jdk1.8.0_121\bin\javaw.exe
- On Unix systems, you can choose the
java
that is in your$PATH
(as shown in the Linux example) or you can use an absolute path (as shown in the macOS example). The former wouldn't require updating when you upgrade your Java version, but the latter never changes when you upgrade Java meaning that you know which version is used to run Eclipse.- On Linux (you can use
update-alternatives
to find all versions):
-vm /usr/bin/java
- On macOS (all JREs can be found by executing
/usr/libexec/java_home -V
, just be sure you pick one withjdk
in the name!):
-vm /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java
- On Linux (you can use
- For example, the file might contain this on Windows:
- Determine where your Java executable is stored.
You can now start Eclipse.
- From within Eclipse, select Help, and Install New Software...
- Click the Add button
- For name, enter Gradle and for location enter
http://dist.springsource.com/release/TOOLS/gradle
- Click OK
- From the Working with: field, select the Gradle address you have just added.
- Eclipse should now search the address for installable modules. Tick all options, the Extensions / Gradle Integrations and the Uncategorised option.
- Click Next and the components should start downloading (this can take a while).
- Click Next, accept the licence
- Click Finish and Eclipse will do the final install.
- Go to GitHub
- Register yourself, then sign in.
- In the Search GitHub field type maptool and enter. This will bring up the a few repositories, select RPTools/maptool which is Craig's master repository.
- Click the Fork button to make your own copy of the project.
- Download and install GitHub for Windows from https://windows.github.com/
- Start GitHub for Windows
- Configure Git for Windows with your GitHub username and password. Once your client can connect to GitHub you can make a local clone.
- Click the + Icon, in the top left.
- Click Clone and you should see your username and your maptool project, which you should select.
- Click the Clone option towards the bottom of the screen, a directory dialog box should appear.
- Select your Eclipse workspace directory. This will create a maptool project directory in your workspace.
- Open Eclipse.
- Select File and Import
- Select Gradle Project and click Next
- Browse to your
\maptool
directory - Click the Build Model button. This should search the directory and find the parent MapTool project and the two child projects, launcher and maptool
- Select all projects (click the parent MapTool project)
- Click the Finish button. This will start building your project in Eclipse. I had to click a few Run In Background boxes at this point, but it completed okay. You should now have a launcher and a maptool project in your Eclipse workspace.
- Expand your maptool project. You should see JRE System Library as one of the project components. It should also say which version and if you have followed the steps exactly as described above, it will be JRE System Library [jdk1.8.0_40] where as we actually want a Java1.7 version.
- To change this, select your maptool project, the select Project and Properties which should open the project properties window.
- Select Java Build Path from the options on the left.
- Click the Libraries tab, select the JRE System Library and then click Edit
- Click the Alternate JRE option and then press the Installed JREs... button.
- Click Add, Standard VM and Next. Then click the Directory button to navigate to your Java 1.7 directory. Usually
C:\Program Files\Java\jdk1.7.75
. Then click Finish and Ok - You should now be able to select jdk1.7.0_75 as your project JRE and click Finish and close the properties window.
- Now build the project by right clicking the maptool project, then Gradle and Tasks Quick Launcher
- A small dislogue window should pop up, type Build into the Tasks field and press enter. The project should now build and you should see something like:
[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts] Build
[sts] -----------------------------------------------------
Creating Release
:maptool:copyLibs UP-TO-DATE
:maptool:compileJava UP-TO-DATE
:maptool:processResources UP-TO-DATE
:maptool:classes UP-TO-DATE
:maptool:jar UP-TO-DATE
:maptool:assemble UP-TO-DATE
:maptool:compileTestJava UP-TO-DATE
:maptool:processTestResources UP-TO-DATE
:maptool:testClasses UP-TO-DATE
:maptool:test UP-TO-DATE
:maptool:check UP-TO-DATE
:maptool:build UP-TO-DATE
BUILD SUCCESSFUL
Total time: 2.434 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 2 sec
[sts] -----------------------------------------------------
- Select your maptool project
- Click Run and Run Configurations... which will open a dialogue window.
- Select Java Application from the left and then create a new configuration by clicking the new button.
- Make sure the project field says maptool
- In the Main Class field enter
net.rptools.maptool.client.MapTool
or click the Browse button and search for maptool - Click Apply
- Click Run, this should now launch MapTool 1.4
If you got through all that, congrats!