You get this error because you are not using the version of Eclipse provided by Stanford University. For more details,
Edit: deleted this link since it no longer works.
Edit:
Since the above link no longer works, I wrote the following steps. Since I no longer use Karel, if someone has followed the guide and can make any corrections, leave a comment to edit this answer.
Instructions:
Visit the Stanford website and download the following software
- Eclipse for windows from Stanford
- Java Jre Software
B. Install the software.
Download the Assignment1.zip file from the Destinations tab.
d. Install Destination in Eclipse.
Now we are done with the installation guide. Let's talk about common issues:
Problems:
Problem 1: Blank Screen
This means that you have installed the latest Sun Java JRE software. The solution to this is I. Uninstall all versions of the JRE software except the one downloaded from the Stanford website.
OR try this
Eclipse open source software.
On the menu toolbar, click Window, and then click Settings.
from. Follow these simple steps:
- In the settings window, click Java.
- In the drop-down section shown in the Java section, click Installed JREs.
- The JRE we downloaded from the Stanford website is an update to jre6 2. So select it. Only jre6 is compatible with stanford eclipse software. Therefore, uncheck all other versions installed on your system and select the jre6 check box, as shown in the figure below.
- Click Ok. 5. Run the program. Now you can see that the output is ok.
Problem 2: Error
When you run the program, you may sometimes notice this error.
*
*Exception in thread "main" java.lang.NullPointerException at acm.program.Program.main(Program.java:917) at stanford.karel.Karel.main(Karel.java:202)*
*
This means that you have not downloaded the Stanford Eclipse software and are using the latest version of Eclipse that you downloaded from the Eclipse website. So follow the detailed guide that I mentioned above. Everything will work fine
source share