문제

I am trying to follow this tutorial to be able to use Jade (Java Agent Development Framework). I am pretty new with java. I have a problem with this command: (I am using Mac OSx)

java -cp lib\jade.jar;classes jade.Boot -gui -agents ping1:examples.PingAgent.PingAgent 

I get this error:

Usage: java [-options] class [args...]
       (to execute a class)
or  java [-options] -jar jarfile [args...]
       (to execute a jar file)
...
-bash: classes: command not found

I have set my environment variables like this:

export CLASSPATH=$CLASSPATH:/Applications/jade/classes
export CLASSPATH=$CLASSPATH:/Applications/jade/lib/jade.jar

and here is the hierarchy of the folders: enter image description here

If you need some more information to understand the problem please let me know.

도움이 되었습니까?

해결책

Try adding quotes around your class path: java -cp "lib\jade.jar;classes" .... Without them, bash interprets the semi colon as the start of a new command, which causes the error message -bash: classes: command not found

Edit

It just struck me that you of course are running in *nix. Then the path separator would be :, not ;. Then the quotes shouldn't even be needed. Semi colon is the path separator in Windows.

다른 팁

Try

java -cp "lib\jade.jar;classes" jade.Boot -gui -agents ping1:examples.PingAgent.PingAgent 

Looks like bash is treating the ; as end of command and treats classes as a new command.

The command is in Windows notation, not Unix one. On Unix systems You have to use lib/jade.jar instead of lib\jade.jar

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top