简体   繁体   中英

Unable to find/install the Java package acm.graphics

I get the following error message

RobotFace.java:3: package acm.graphics does not exist
import acm.graphics.*; 
^

It suggests me that I do not have acm.graphics -package.

I have tried to find and install the package in MacPorts unsuccessfully by

port search acm

How can you install acm.graphics package in your computer for Java?

As stated in the answer below, you need the acm.jar file. Here's how to do it in 3 easy steps:
1. Under "downloads", download the acm.jar file here: Stanford's website .
2. See screenshots below. I'm using NetBeans for my IDE, but it should be more or less the same for any IDE. I right-clicked "libraries" and added the acm.jar file. (Note from screenshots: I took these screenshots after I installed the acm.jar file. You won't see this in your libraries folder until after you have completed this procedure.)
3. Refresh your project.

库文件夹

右键点击

A quick Google search yielded http://jtf.acm.org/ .

Note there is a "acm.jar" file. You need to download that and add it to your CLASSPATH.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM