1Z0-811 Exception Handling and Development Tools Practice Question
What does the java command with -jar option do?
⚠ Common exam trap
Oracle often tests the misconception that `java -jar` compiles or manipulates the JAR file, when in fact it strictly executes the application defined in the manifest.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Executes a JAR file by reading its manifest
The `java -jar` command executes a JAR file by reading the `Main-Class` entry from the JAR's manifest file (`META-INF/MANIFEST.MF`). This tells the Java launcher which class contains the `public static void main(String[] args)` method to start the application. It does not compile, list, or create JAR files.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Compiles Java files inside the JAR
Why it's wrong here
compilation is done by javac.
- ✓
Executes a JAR file by reading its manifest
Why this is correct
java -jar runs the JAR with the class from manifest.
- ✗
Lists contents of the JAR file
Why it's wrong here
listing is done with jar tf.
- ✗
Creates a new JAR file
Why it's wrong here
Creating JAR files is done with jar command.
Go deeper
Related to this question
About these practice questions
This 1Z0-811 question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.