Java ACM 包

发布于 2024-09-24 15:19:41 字数 600 浏览 3 评论 0原文

我正在尝试在 Eclipse 中编写一个 java 应用程序。

我真的很想使用 ACM.Program 包,但是,我的 Eclipse 副本没有安装它!

我查遍了整个网络,但找不到 ACM 包的下载。

更多信息: 每当我尝试代码时:

package helloGeiodo;
import acm.program.*;

public class Add2 extends Program {

   public void run() {
      println("This program adds two numbers.");
      int n1 = readInt("Enter n1: ");
      int n2 = readInt("Enter n2: ");
      int total = n1 + n2;
      println("The total is " + total + ".");
   }

} 

我都会出现错误,所有这些都意味着不存在“acm.program”这样的东西。

无论如何,我需要知道在哪里可以找到 ACM 软件包,以及如何安装它。

谢谢!

——弗林

I'm trying to write a java application in Eclipse.

I'm really wanting to use the ACM.Program package, however, my copy of Eclipse doesn't have it installed!

I've looked all over the net, and I can't find a single download for the ACM package.

More info:
Whenever I try the code:

package helloGeiodo;
import acm.program.*;

public class Add2 extends Program {

   public void run() {
      println("This program adds two numbers.");
      int n1 = readInt("Enter n1: ");
      int n2 = readInt("Enter n2: ");
      int total = n1 + n2;
      println("The total is " + total + ".");
   }

} 

I get errors up and down the ying-yang, all implying that there is no such thing as "acm.program".

Anyways, I need to know where to find the ACM package, and, how to install it.

Thanks!

--Flynn

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

兮子 2024-10-01 15:19:41

您可以从 ACM Java Task Force 下载 acm.jar,然后将其添加到您的类路径

看来之前的链接已经失效了。这些文件仍然可以在 Eric Roberts 的斯坦福页面上找到。

You can download acm.jar from the ACM Java Task Force and then add it to your classpath.

It appears that the previous link is dead. The files are still available at Eric Roberts' Stanford page.

无人问我粥可暖 2024-10-01 15:19:41

一般答案是:

  1. 从相关站点下载 JAR 文件,
  2. 将它们复制(或导入)到您的 Eclipse 项目中。人们经常将外部 JAR 放入 lib 目录中,但这只是个人选择。
  3. 将它们添加到项目的构建路径中。

但是,我不建议使用“ACM”类。这是一个有趣的想法,但没有流行起来。

The general answer is:

  1. Download the JAR files from the relevant site
  2. Copy (or import) them into your Eclipse project. People often put external JARs into a lib directory, but that's just a personal choice.
  3. Add them to the project's build path.

However, I wouldn't recommend using the "ACM" classes. They were an interesting idea, but they didn't catch on.

执着的年纪 2024-10-01 15:19:41

如果您学习斯坦福课程,则可以将作业(.zip 文件)直接导入到新的 Java 项目中。

If you follow the Stanford courses, you can import the Assignment directly (.zip files) into a new Java project.

掩于岁月 2024-10-01 15:19:41

jtf.acm.org 他们让你在那里下载它。

jtf.acm.org They let you download it there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文