java - 斯坦福 CS106a : some java applet errors that do not allow to run the programs

标签 java

无法解决此屏幕中的问题。

http://s8.postimage.org/n5osf76ed/qestions.jpg

所有代码在一个月前就可以运行。 我改变了什么:我有一个不同版本的 eclipse(现在:Eclipse IDE for Java Developers 1.5.1.20120920-0737,不知道以前的版本是什么)。

搞砸了环境变量。由于这不会影响 ot

请帮忙。

最佳答案

试试 this discussion 中提到的解决方案.

I just ran into this problem using standard (not Stanford) Eclipse. By now this is probably moot for you, but I'll post my solution for future travelers.

The launch configurations for Assignment 1 default to Applet, so the containing Karel application isn't launched. To solve this, create and use new Application launch configurations for each file.

If you already tried to run some of the files, delete the Applet configs created so you can reuse the names:

  1. Open the project properties (e.g. right click on Assignment 1 and select Properties).
  2. Select Run/Debug Configurations.
  3. Select and Delete each configuration.
  4. Click OK.

May the Force be with you.

Create Application configs:

  1. Right click on java file (e.g. CollectNewspaperKarel.java) and select Run As > Run Configurations...

  2. Select Java Application in the left pane.

  3. Click New Launch Configuration (the icon of a document with a +).

  4. Type a name for the configuration and set its Main class to the associated file (e.g. CollectNewspaperKarel).

  5. Click Apply then Run. (This should run correctly and create a useful entry in the Run History.)

Eclipse will still try to default to Applet, so you will henceforth need to launch these configurations from the Run History (either from the Run menu or the pull down on the run button). If you accidentally launch as default, it will add a useless Applet configuration to the Run History (e.g. CollectNewspaperKarel (1) ). You can delete this from the Run Configurations dialog to keep the Run History tidy.

关于java - 斯坦福 CS106a : some java applet errors that do not allow to run the programs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13965280/

相关文章:

java - 如何在正则表达式模式中添加撇号空格和破折号并避免它们彼此相邻

多线程环境中的 Java 单例类行为

java - 防止使用相同的登录凭据进行多次登录

java - 通过继承改进程序

java - 无法使用 ShadowJar 运行构建的 gradle 项目 NoClassDefFoundError

java - 在使用 Java 6 的 Mac 上运行 JavaFX 2?

java - 如何确保执行最新版本的类文件?

java - 我需要将随机生成的数字插入数组

java - 在 Hadoop MapReduce 作业中链接 Multi-Reducer

java - 如何在使用 Ant/Jenkins 时 check out 同一 Java 项目的不同 Subversion 标签/分支?