Using the ForkJoin Framework in Eclipse

More extensive notes can be found on Notes on the Java ForkJoin Framework for CSE332.

  1. Download the jsr166.jar file here
  2. Create your Java project as usual in Eclipse.
  3. In the project, choose Project → Properties from the menu. Under "Java Compiler" check "Enable project specific settings" and make sure the choice is Java 1.6 (earlier versions will not work).
  4. Drag & drop the jsr166.jar file you just downloaded onto the Java Project you just created in the Package Explorer window of Eclipse.
  5. Right-click the newly-added .jar file, and choose "Add to Build Path."
  6. Under Run → Configurations, create a new configuration. Under Arguments, you are used to putting program arguments in the top and that is as usual. But also under "VM arguments" on the bottom you need to enter: -Xbootclasspath/p:jsr166.jar exactly like that.
  7. Create/add your class (New→Class) with a main method you can run:

Troubleshooting

Having trouble? Possible issues: