It's not a secret anymore!*
The moose likes Mock Exam Errata and the fly likes Bonus MasterExam errata? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Bonus MasterExam errata?" Watch "Bonus MasterExam errata?" New topic
Author

Bonus MasterExam errata?

Taariq San
Ranch Hand

Joined: Nov 20, 2007
Posts: 192
"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

Joined: Jun 04, 2002
Posts: 3178
    
    3
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.


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3178
    
    3
Also, when you run а JAR file, you must anyway spefify Main Class property .class in MANIFEST.MF file.
Taariq San
Ranch Hand

Joined: Nov 20, 2007
Posts: 192
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bonus MasterExam errata?
 
Similar Threads
running application with double click
Problem creating .JAR file with Jess
ClassNotFoundException while executing using "java -jar" command
System.exit() capture using bat or shell script
Jar - more than 1 main