简体   繁体   English

找不到/安装Java包acm.graphics

[英]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. 这表明我没有acm.graphics -package。

I have tried to find and install the package in MacPorts unsuccessfully by 我试图在MacPorts中找到并安装该软件包,但未成功

port search acm

How can you install acm.graphics package in your computer for Java? 您如何在计算机上为Java 安装acm.graphics软件包

As stated in the answer below, you need the acm.jar file. 如下面的答案所述,您需要acm.jar文件。 Here's how to do it in 3 easy steps: 以下是3个简单步骤的操作方法:
1. Under "downloads", download the acm.jar file here: Stanford's website . 1.在“下载”下,从以下位置下载acm.jar文件: Stanford的网站
2. See screenshots below. 2.请参见下面的屏幕截图。 I'm using NetBeans for my IDE, but it should be more or less the same for any IDE. 我将NetBeans用于我的IDE,但对于任何IDE,它应该大致相同。 I right-clicked "libraries" and added the acm.jar file. 我右键单击“库”并添加了acm.jar文件。 (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.) (屏幕截图中的注释:安装acm.jar文件后,我截取了这些屏幕截图。在完成此过程之后,您才能在libs文件夹中看到此屏幕。)
3. Refresh your project. 3.刷新您的项目。

库文件夹

右键点击

A quick Google search yielded http://jtf.acm.org/ . 快速的Google搜索产生了http://jtf.acm.org/

Note there is a "acm.jar" file. 请注意有一个“ acm.jar”文件。 You need to download that and add it to your CLASSPATH. 您需要下载该文件并将其添加到您的CLASSPATH中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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