简体   繁体   English

需要包含acm.program

[英]acm.program needs to be included

I watched the Stanford online video lecture about java programming by Mehran Sami. 我观看了Mehran Sami撰写的有关Java编程的斯坦福在线视频讲座。

In every program, you need to include the acm.program. 在每个程序中,都需要包含acm.program。

How should I deal with it? 我应该如何处理?

How could I include the acm.program inside the code? 如何在代码中包含acm.program?

acm.program sounds like a package, which will contain classes used by the programs created in the lectures. acm.program听起来像一个包,它将包含在讲座中创建的程序所使用的类。

I assume you downloaded these as a .jar, which you need to add to your eclipse project. 我假设您将这些文件下载为.jar,需要将其添加到eclipse项目中。 Right click on your project and follow a path, which i think is: 右键单击您的项目,并遵循一条路径,我认为是:

Project => Properties => Java Build Path => Libraries => Add JAR ... 项目=>属性=> Java构建路径=>库=>添加JAR ...

Then select the jar, click ok, and the classes should be available to you. 然后选择罐子,单击“确定”,您应该可以使用这些类。

EDIT: Once you've done that you can import the classes you need by adding the following line to the top of you java file: 编辑:完成后,可以通过在Java文件顶部添加以下行来导入所需的类:

import acm.program.*;

or individual classes like: 或个别类别,例如:

import acm.program.DialogProgram;

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

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