Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stanford CS106a: some java applet errors that do not allow to run the programs

Tags:

java

Wasnt able to solve the problems in this screen.

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

All the code worked a month ago. What have I changed: I have a different version of eclipse (now: Eclipse IDE for Java Developers 1.5.1.20120920-0737, don't know what the previous one was).

Messed with environment variable. Since this does not effect the ot

Please help.

like image 357
user1917633 Avatar asked Oct 25 '25 06:10

user1917633


2 Answers

Try this solution mentioned in 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.

like image 196
Stanley Avatar answered Oct 26 '25 20:10

Stanley


The eclipse used in CS106A is customized for stanford and for "karel the robot" :) Just download and install it again and things should work just fine.

like image 43
arunmoezhi Avatar answered Oct 26 '25 19:10

arunmoezhi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!