A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where the old
one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob
using the command:java -classpath /test:/home/bob/downloads/*.jar games.Chess Bob's CLASSPATH is set (at login time) to:
/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jarWhat is a possible location for the Chess.class file?A. /test/Chess.class
B. /home/bob/Chess.class
C. /test/games/Chess.class
D. /usr/lib/games/Chess.class
E. /home/bob/games/Chess.class
F. inside jarfile /opt/java/lib/Games.jar (with a correct manifest)
G. inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)这道题目搞得头晕了!
大家帮忙看看

解决方案 »

  1.   

    执行时设置了环境变量 classpath /test:/home/bob/downloads/*.jar
    所以只在 /test目录,/home/bob/downloads/*.jar这个范围内找class文件吧
    所以只能是 /test/games/Chess.class
      

  2.   

    java
    -classpath,设定要搜索的类的路径,可以是目录,jar文件,zip文件(里面都是class文件),会覆盖掉所有的CLASSPATH的设定。