开发者

Karel Robot: Could not find or load main class

I run this command to compile, it runs successfully:

javac -d . -cp .;KarelJRobot.jar StairClimber.java

Then I use this to try and run my class:

java -d –cp .;KarelJRobot.jar StairClimber

and I get this:

Error: Could not find or load main class ûcp

This is the entire class file:

import kareltherobot.*;

public class StairClimber {
    public static void main(Strin开发者_高级运维g[ ] args)
    {   
        /* You fill this in */
        World.setVisible(true);
    }
}

I got the Karel Simulator from here:

http://csis.pace.edu/~bergin/KarelJava2ed/KJRDistribution060110.zip


java -d –cp .;KarelJRobot.jar StairClimber
--------^

Your cp argument hyphen is wrong. You need the - one next to 0 on your (US) keyboard. Do not copypaste the command from some PDF file or website. Enter the command all yourself.

java -d -cp .;KarelJRobot.jar StairClimber


Try using the below (also, : instead of ;) :

java -cp .:KarelJRobot.jar StairClimber

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜