Using the ForkJoin Framework

Using the ForkJoin Framework

First and foremost, read Dan's intro to the framework; reading and following its directions can save a fair amount of anguish later on. The steps listed in this html page are in part a summary of Dan's text, though some is added and some is left out.

There are alternatives to the steps below, but it'll save you a headache to follow through these the first time, even if they differ from the way you normally do things in eclipse.
  1. Download the jar here
  2. Outside of Eclipse, create a new directory in which you want to place your forkjoin project; place the jar there
  3. In Eclipse, create a new project, but choose the 'Create Project from Existing Source' option while doing so; choose the directory into which you have just placed the jar file
  4. Now for some settings: go to Project->Properties and under "Java Compiler" check "Enable project specific settings", and make sure everything is set to Java 1.6 (if you don't have 1.6 installed, you'll need to do so before proceeding)
  5. Still in Project->Properties, go to "Java Build Path", then Source, choose "Add Folder", and select the directory you added above.
  6. In your new project, create a new 'Source Folder', if one doesn't show up already
  7. Create/add your class to the source folder; make sure it has a main method:
  8. You need a particular run configuration for this whole thing to work: Create a new run configuration and under arguments, in VM Arguments, put the following: -Xbootclasspath/p:jsr166.jar

Troubleshooting

I ran into a number of possibilities setting this set up the first time, so allocate a bit of extra time to get it up and running. If you run into problems: