Java ACM 包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3796879/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 05:06:51  来源:igfitidea点击:

Java ACM package

javaeclipseideacm-java-libraries

提问by Georges Oates Larsen

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

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

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

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

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

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

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".

我在 ying-yang 上下都有错误,都暗示没有“acm.program”这样的东西。

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

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

Thanks!

谢谢!

--Flynn

--弗林

采纳答案by ide

You can download acm.jarfrom the ACM Java Task Forceand then add it to your classpath.

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

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

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

回答by Stephen C

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 libdirectory, but that's just a personal choice.
  3. Add them to the project's build path.
  1. 从相关站点下载 JAR 文件
  2. 将它们复制(或导入)到您的 Eclipse 项目中。人们经常将外部 JAR 放入lib目录中,但这只是个人选择。
  3. 将它们添加到项目的构建路径中。

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

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

回答by Ikechi Anyanwu

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

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

回答by A_rnO

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

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