Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can you help me get started with acm.jar?

843789May 17 2010 — edited May 17 2010
I am a total newbie to Java. I have successfully run the usual "HelloWorld" program, but am having trouble using jars.

I have the following on my C:drive under the Program Files Folder:
Java, under which is jdk1.6.0_20, under which is lib, under which is acm.jar.
Program Files
Java
jdk1.6.0_20
lib
acm.jar

I have set the system variable CLASSPATH to: C:\Program Files\Java\jdk1.6.0_20\lib
I have set the user variable Java to: C:\Program Files\Java\jdk1.6.0_20\bin

I am trying to compile the program BouncingBall.java (stored at C:\Documents and Settings\Owner\My Documents\Temp) which includes these lines:
import acm.program.*;
import acm.graphics.*;

At the command prompt C:\Documents and Settings\Owner\My Documents\Temp
I have tried:
javac -classpath acm.jar BouncingBall.java
and simply:
javac BouncingBall.java

Both these attempts give me a long list of errors of the type "BouncingBall.java:11: class, interface, or enum expected"

Can someone please help me get on the right path here? Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2010
Added on May 17 2010
9 comments
1,440 views