Eclipse IDE Install for Maptool 1.4 for a clean Windows PC

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Eclipse IDE Install for Maptool 1.4 for a clean Windows PC

Post by Jagged »

I "sort of" volunteered to produce some installation instructions for Eclipse for Maptool 1.4. It seemed straight forward so I wasn't sure if there was much need, but I thought I would do it anyway and maybe add some optional extras in there. So here are the necessary steps for a clean and empty Windows PC.

Install Java JDK
Install Java JDK
As you are here on the Maptool site, you almost certainly already have Java installed on your PC. You may not have a software development kits, which you will need if you want to do any coding. You may also want to install multiple versions of java. If you run old versions of Maptool you will have Java 6. For Maptool 1.4 you will need Java 7 (1.7) and possibly Java 8. If you haven't already, lets install both!

Note: At this stage you need to know if your PC is 64bit or 32bit. If you are not sure, open "Windows Explorer", right click on "Computer" and select "Properties". This opens the Control Panel Homes Page about your PC and in the "System" section against the "System Type" it will say either "32-bit Operating System" or 64.

Install latest Java SE Development Kit 7
1. Go to the Java 7 Downloads Page
2. Click the "Accept License Agreement" radio button
3. Download the "Windows x64" (for 64bit Windows) or "Windows x86" (for 32 bit) Java SE Development Kit. At the time of writing the 64bit file is "jdk-7u75-windows-x64.exe"
4. Run the installer file you have just downloaded. This will try and install to a directory like: "C:\Program Files\Java\jdk1.7.75", which is fine. If the directory says JRE instead of JDK then you have downloaded the wrong file. Don't worry if you have both, the JDK contains a JRE.


Install latest Java SE Development Kit 8
1. Go to the Java 8 Downloads Page
2. Click the "Accept License Agreement" radio button
3. Download the "Windows x64" (for 64bit Windows) or "Windows x86" (for 32 bit) Java SE Development Kit. At the time of writing the 64bit file is " jdk-8u40-windows-x64.exe"
4. Run the installer file you have just downloaded. This will try and install to a directory like: "C:\Program Files\Java\jdk1.8.0_40". If the directory says JRE instead of JDK then you have downloaded the wrong file. Don't worry if you have both, the JDK contains a JRE.
Install Eclipse IDE for Java EE Developers
Install Eclipse IDE
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 its perfectly possible for different IDE Plugins to disagree with each other, third party developers cannot always be relied upon. 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 config 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 (Java 8 ).

1. Go to the Eclipse Downloads Page
2. Download the "Eclipse IDE for Java EE Developers" not the basic "Eclipse IDE for Java Developers", grabbing the 64bit or 32bit as appropriate. At the time of writing the latest build is "Luna" and the 64bit file is "eclipse-jee-luna-SR2-win32-x86_64.zip"
3. Decide where you want to install Eclipse. The Eclipse install is nothing more than unzipping the zip file. The default location would usually be "C:\Program Files\eclipse". If you simply extract the zip file, it will create the top level "eclipse" directory.
4. Create a shortcut for Eclipse. Copy the "eclipse.exe" file from your Eclipse directory and paste it as a shortcut onto your desktop.
5. Specify a directory to store your Eclipse configuration. By default Windows will store this in "C:\User\Username\.eclipse" but you should override this if you want to use multiple configurations.
5.1 Create a new folder, I recommend storing it at the same level as your workspace folder but not in your workspace folder. So my workspace folder is "C:\Data\Workspace" and my config directory is "C:\Data\.eclipse". Windows will not let you begin a folder name with a period, so create the folder and drop to the command line and rename it.
5.2 Right click your Eclipse shortcut, click "Properties" and edit the target line. Add the following -configuration F:\Data\.eclipse where the path matches the directory you just created. If the path contains spaces you can surround the path in quotes.
6. Specify the Eclipse JVM.
6.1 Open the Eclipse directory (usually "C:\Program Files\eclipse") and edit the eclipse.ini file. Add the lines below, where the path matches your newest Java release.

Code: Select all

-vm
C:\Program Files\Java\jdk1.8.0_40\bin\javaw.exe
7. You can now start Eclipse.

Install Eclipse Gradle Plugins.
1. From within Eclipse, select Help, and Install New Software...
2. Click the "Add" button
3. For name enter "Gradle" and for location enter "http://dist.springsource.com/release/TOOLS/gradle" then click OK
4. From the "Working with:" field select the Gradle address you have just added.
5. Eclipse should now search the address for installable modules. Tick all options, the "Extensions / Gradle Integrations" and the "Uncategorised" option.
6. Click "Next" and the components should start installing (this takes a while). Then click "Next", accept the licence and "Finish" and Eclipse will do the final install.

Getting Maptool from GitHub
1. Go to GitHub
2. Register yourself, then sign in.
3. 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.
4. Click the "Fork" button to make your own copy of the project.
5. Download and install "GitHub for Windows" from https://windows.github.com/
6. Start "GitHub for Windows"
7. Configure Git for Windows with your GitHub username and password. Once your client can connect to GitHub you can make a local clone.
8. Click the + Icon, in the top left.
9. Click "Clone" and you should see your Username and your "maptool" project, which you should select.
10. Click the "Clone" option towards the bottom of the screen, a directory dialogue box should appear.
12. Select your Eclipse workspace directory. This will create a maptool project directory in your workspace.

Build the Maptool Gradle Project
1. Open Eclipse.
2. Select File and Import
3. Select "Gradle Project" and click "Next"
4. Browse to your \maptool directory
5. Click the "Build Model" button. This should search the director and find the parent "Maptool" project and the two child projects, "launcher" and "maptool"
6. Select all projects (click the parent "Maptool" project)
7. 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.
8. 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.
9. To change this, select your "maptool" project, the select "Project" and "Properties" which should open the project properties window.
10. Select "Java Build Path" from the options on the left.
11. Click the "Libraries" tab, select the "JRE System Library" and then click "Edit"
12. Click the "Alternate JRE" option and then press the "Installed JREs..." button.
13. Click "Add", "Standard VM" and "Next". The 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"
14. You should now be able to select "jdk1.7.0_75" as your project JRE and click "Finish" and close the properties window.
15. Now build the project by right clicking the "maptool" project, then "Gradle" and "Tasks Quick Launcher"
16. 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:

Code: Select all

[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] -----------------------------------------------------
Run Maptool from within Eclipse
1. Select your "maptool" project
2. Click "Run" and "Run Configurations..." which will open a dialogue window.
3. Select "Java Application" from the left and then create a new configuration by clicking the "new" button.
4. Make sure the project field says "maptool"
5. In the Main Class field enter "net.rptools.maptool.client.MapTool" or click the "Browse" button and search for "maptool"
6. Click "Apply"
7. Click "Run", this should now launch Maptool 1.4

If you got through all that, congrats!
Optional Extras!
Extras
You thought you were done? Sorry, there are two extra things you may wish to consider and both are related to managing UI elements within Maptool. The current edition of the tool uses Albeille to manage Swing elements within the design. Albeille is a WYSIWYG form designer for Swing objects and if you plan on modifying any of the UI elements you should definitely install the Albeille Designer. As Swing is now depreciated within Java the plan is to move those elements over to JavaFX, although this is work is further down the line at the moment. If you want to get to grips with JavaFX, you should probably install the Eclipse Plugin "e(fx)clipse" (bloody stupid name) and the JavaFX Scene Builder. Scene Builder is also a WYSIWYG form designer, but this time for JavaFX Objects.

Install Albeille
1. Go to the Albeille Downloads page and download the latest binaries. This is a close project so they are quite old. The binaries are jar files so you can simply unzip the folder to anywhere on your PC, such as "C:\Program Files (x86)\abeille-2.1.0_M3"
2. Launch the Designer by running the "designer.jar" file in the "abeille-2.1.0_M3" directory. If you have installed Java as described above, you can just right click the file and select "Open"
3. Once the Designer is running, you need to create a new project for the Maptool forms. Call this file "maptool.jfpr" and save it anywhere you like, BUT NOT in the Eclipse Maptool project directory, as you do not want this file to become part of the Maptool project and is only used by you locally.
4. Add the Maptool resource directory as a Source path for your Abeille Project. On the Abeille Project Settings screen you should see a button in the Source Tab to "Add Path". Click this and navigate to the resource directory. For example, if your Eclipse workspace directory was "C:\Workspace" and your top level Maptool project was called "C:\Workspace\maptool" you should add the path "C:\Workspace\maptool\maptool\src\main\resources". This is very important, otherwise the Albeille Designer will save the local path names into the designer files rather than the relative paths that are needed for proper distribution.

Install e(fx)clipse Plugin
1. From within Eclipse, select Help, and Install New Software...
2. Click the "Add" button
3. For name enter "e(fx)clipse" and for location enter " http://download.eclipse.org/efxclipse/u ... .2.0/site/" then click OK
4. From the "Working with:" field select the e(fx)clipse address you have just added.
5. Eclipse should now search the address for installable modules. Tick all options, the "e(fx)clipse - install" and the "e(fx)clipse - single components" option.
6. Click "Next" and the components should start installing (this takes a while). Then click "Next", accept the licence and "Finish" and Eclipse will do the final install.

Install JavaFX Scene Builder
The JavaFX Scene Builder application has been handed over to the open source community and as a consequence it can be hard to find the Scene Builder install. The last Oracle version can be found on the JavaFX Scene Builder Archive page.
1. Download the "Windows 32/64 bit (msi)" from the "JavaFX Scene Builder 2.0 Related Downloads" section found towards the bottom of the page.
2. Execute the msi file as normal. This will install the application and make a file associatino to the FXML extension.
3. You should now be able to open FXML files from within Eclipse with Scene Builder.
DiceLib and RpLib
Installing DiceLib and RpLib in Eclipse
Installing DiceLib and RpLib in Eclipse
If you want to play with any of the basic dice rolling functions you will need to modify the DiceLib sub-project. To do this you follow the same steps as for Maptool but will one additional step. To build the dicelib project, it is necessary to run gradle with the "-Pversion" parameter as described below.

Configure Gradle for Dicelib and RpLib
1. Open Eclipse
2. Select Window and Preferences
3. Expand the Gradle option and select Arguments
4. In the "Program Arguments(requires Gradle1.0-rc-2)" section, click the "Use:" radio button and enter "-Pversion=1.4.0.1-SNAPSHOT" into the text field.
5. Then click "Apply" and close the window.

Getting Dicelib from GitHub
1. Go to GitHub
2. Register yourself, then sign in.
3. In the "Search GitHub" field type "dicelib" and enter. This will bring up the a few repositories, select "RPTools/dicelib" which is Craig's master repository.
4. Click the "Fork" button to make your own copy of the project.
5. Download and install "GitHub for Windows" from https://windows.github.com/
6. Start "GitHub for Windows"
7. Configure Git for Windows with your GitHub username and password. Once your client can connect to GitHub you can make a local clone.
8. Click the + Icon, in the top left.
9. Click "Clone" and you should see your Username and your "dicelib" project, which you should select.
10. Click the "Clone" option towards the bottom of the screen, a directory dialogue box should appear.
12. Select your Eclipse workspace directory. This will create a maptool project directory in your workspace.

Build the Dicelib Gradle Project
1. Open Eclipse.
2. Select File and Import
3. Select "Gradle Project" and click "Next"
4. Browse to your \dicelib directory
5. Click the "Build Model" button. This should search the directory and find the "dicelib" project
6. Click the "dicelib" project
7. Click the "Finish" button. This will start building your project in Eclipse
8. Now build the project by right clicking the "dicelib" project, then "Gradle" and "Tasks Quick Launcher"
9. A small dialogue window should pop up, type "build" into the Tasks field and press enter. The project should now build and you should see something like:

Code: Select all

[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks: 
[sts]      build
[sts] -----------------------------------------------------
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:spotlessJavaCheck
:spotlessCheck
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check
:build

BUILD SUCCESSFUL

Total time: 1.571 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 1 sec
[sts] -----------------------------------------------------
Run Maptool from within Eclipse Using your Local Dicelib Project
1. Right click you "maptool" project in Eclipse and select "Properties"
2. Click "Java Build Path"
3. Select the "Projects" tab
4. Click the "Add..." button and select the dicelib project
5. Run Maptool from Eclipse as normal
Last edited by Jagged on Mon Nov 23, 2015 11:55 am, edited 16 times in total.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by JamzTheMan »

Thanks for the write up! Hopefully some new fledglings will give it a go. There are just as many small features as big ones that we could use some help on!

I wish this was a week earlier too, I was initially stumped with the maptool/launcher subprojects and Eclipse hiding the source directories on me. Then I realized I just needed right to click on the maptool/launcher directories and create a new project. Oh course, the import Gradle project looks easier, I just did it the harder way I guess.

I've been posting any other issues/gotchas/questions over in the topic Contributing to MapTool 1.4 but this may be a better place going forward to discuss Eclipse specific issues/tips then. (Mods, fee free to split/move any appropriate posts to here).

Also, I've been having moderate success with eGit for Eclipse. It works ok for checkout, commits, intial pulls, etc. But when it comes to fetching back from upstream and merging back to master, it didn't go well and found the command line to be better.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by RPTroll »

You are a prince(ss) among non-gender specific hominids.

Thanks!

I don't' have windows but will give it a shot on Linux and (assuming I get it to work) will post any changes needed for that OS.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by Jagged »

Updated instructions to say take all plugin options. I was sure I only took the one, when I did it, but testing on another clean install required both.

It was rather late when I did my first write up :(

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by RPTroll »

That's it! I'm cutting your pay. :D

Thanks for this. I was planning on trying it out this weekend on Linux but the honey-do list grew too long and overcame my free time.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by Jagged »

I would be interested in hearing your experience with GotHub tools? Do you manage your commits from within Eclipse? JamzTheMan says he uses the eGit plugins, but I have to say I have always liked keeping the process separate, even when I was using CVS or Subversion. The guys in my office who work on a project that uses GitHub, all seem to have settled on SourceTree, regardless of whether they use NetBeans, IntelliJ or Eclipse. So I am trying to work out why? ;)

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by JamzTheMan »

OK, so loaded SourceTree. I can see some of the appeal. It has a nice clean GUI. eGit shows most of the same information but SourceTree does a better/cleaner job of representing the data. I do like the graph and it's very easy to view commits/branch/history. A little nicer than GitHub.

For typical commits/checkouts/daily work, I would/will probably stick with eGit, I like the integrated workflow.

BUT, for the next merge/fetch/pull request I may try it out.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by Jagged »

Updated OP with extras for Albeille and JavaFX

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by RPTroll »

Thanks for doing this. I hope to dive in someday and this will be a great starting point.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by Jagged »

Added instructions for using the Dicelib project in eclipse.

femanon
Cave Troll
Posts: 95
Joined: Sat Jun 16, 2012 10:25 pm

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by femanon »

can anyone explain if and why someone who isn't a developer should install these? or is it purely only for an administrator or programmer who knows what they are doing?

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by RPTroll »

This is only if you plan on developing Java code for MapTool, TokenTool, etc.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by JamzTheMan »

Probably almost time for an update. :)

I'm finding it easier and easier every year at least. Just install Eclipse Neon with a fresh workspace. I'm now able to get up and running very quickly. The basic Neon package has everything you need (egit, gradle, fx, etc). Don't think I installed any plug-ins this time (ok 1, for a syntax highlighting gradle editor)

But ya, install, Add Project -> point to git repo, boom! Gradle is so nice!
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by aliasmask »

JamzTheMan wrote:Probably almost time for an update. :)

I'm finding it easier and easier every year at least. Just install Eclipse Neon with a fresh workspace. I'm now able to get up and running very quickly. The basic Neon package has everything you need (egit, gradle, fx, etc). Don't think I installed any plug-ins this time (ok 1, for a syntax highlighting gradle editor)

But ya, install, Add Project -> point to git repo, boom! Gradle is so nice!
Is there and Ant build to create a jar file or some other easy way to compile on the needed components?

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Eclipse IDE Install for Maptool 1.4 for a clean Windows

Post by JamzTheMan »

Yes, there's a gradle build. There's a task to build the the Jar (it builds a single jar with all the dependencies included). There are further tasks that create the jWrapper build (a little more setup, you have to have the JRE's unzipped for all 3 OS's somewhere for it to use). We're working on it so a single command creates everything needed ready for deployment.

Even better, all the dependencies are in the gradle.build so when you create a new eclipse "project", point it to the git repo clone/fork, gradle then downloads all the dependancies required and you are pretty much ready to launch/build from there.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Post Reply

Return to “MapTool 1.4”