Install ACM Java task force library in 64bit (Windows)

Prerequisites:

  1. Install java

Summary of what you are going to install:

  1. acm library on 64 bit operating system

At first you should download the acm.jar from this page.

If you try to compile an ACM application from Windows with an 64bit Java JDK installed, you will get the following error message:

Can't load IA 32-bit .dll on a AMD 64-bit platform

Unfortunately (?), ACM only supports 32 bit. If you want to compile it in 64 bit Windows one solution would be to use a virtual machine. Another one would be to perform the following steps:

Step 1 – Install the 32 bit JDK

It is better to download it from the official site (Windows x86):

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

In the wizard installer check that it installs the 32 bit version to a different directory than the one with the 64 bit version (like Program files (x86)\java)

Step 2 – Create a new project

Create a project with your favorite IDE (Netbeans, eclipse, Idea etc)

Step 3 – Add the library to the project

Create a directory lib and copy the jar there.

Configure your IDE to link the jar. Google how to do this.

In Netbeans it is quite simple: right click on libraries and select: “Add jar”. Then select your jar.

In Eclipse you should add it to build path. There are numerous examples in Google search engine.

Step 4 – Create a proxy class to call the main manually

Your IDE may not detect the main within the library. Create a proxy class and call the main manually:

import acm.program.GraphicsProgram;

public class EntryPoint extends GraphicsProgram {
  public static void main(String[] args) {
    new Program3().start(args);
  }
}

 

You should replace Program3 with your own class that includes the ACM run() method.

Step 5 – Move all classes in the default package

You may have a penalty from your tutors if they can prove you used an IDE.

So you should do the following steps:

  1. Use only the default package. Move classes out of there
  2. Remove any IDE autogenerated comments
  3. Deliver only the *.java files written by use without the proxy class.

 

Leave a Reply