• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bonus MasterExam errata?

 
Taariq San
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"When using the java command, only files ending in .class can be executed."

-jar allows a jar file to be executed, or is that seen as a .class file within a .jar file even though it wasn't specified in the java command?

I just thought since I don't specify a class... ah well, if I see this on the exam I'll be sure to nod my head in agreement.
[ June 21, 2008: Message edited by: Taariq San ]
 
Mikalai Zaikin
Ranch Hand
Posts: 3364
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you put .class in .jar file, you can not execute JAR.

IMHO, the question is valid. What is tested here - I am not the question creator 8-) so doing a guesswork - "java" command can only execute compiled bytecode.
 
Mikalai Zaikin
Ranch Hand
Posts: 3364
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, when you run а JAR file, you must anyway spefify Main Class property .class in MANIFEST.MF file.
 
Taariq San
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I agree, but that question could just as easily have been used to trick you in the other direction.
"When using the java command, you must specify the .class file."
That could have been twisted to be true or false in just the same way. True because you must via the manifest, false because your command only specifies the jar file which in turn specifies the class file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic