Setting up Karel the Robot In Eclipse

Exception in thread "main" java.lang.NullPointerException
	at acm.program.Program.main(
	at stanford.karel.Karel.main(

If you are getting this error after you tried to run “Karel the robot” , you are not alone.
Apparently, if you download the version of eclipse that Stanford provides you are unlikely to get the error but if you are like me trying to run your own version of eclipse you will likely get the error.

Here is how to fix it:


Manage to get your application into eclipse. Follow the Stanford tutorial


Click on “Run as Configuration”


Change the main class settings to “stanford.karel.Karel”


Then probably the most important step: Enter “code=CollectNewspaperKarel” in program arguments under the arguments tab.
Click on Apply and then Run your program.

Final Result (Eclipse Indigo)

That should be it.  This was supposed to be easy apparently.

Interesting links:

17 comments Write a comment