๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

Java Programming Foundations Module 5 ยท Lesson 15 of 15

0% Exit to course

Module 5 ยท A real program, end to end Lesson 15 of 15

Packaging, running and publishing

Learning objective

A jar that runs with java -jar, a README that says how to build it, and a Git repository a reviewer can open - that trio turns 'I know Java' into something someone can check.

The concept

Interviewers rarely run your code, but the README and the commit history are read. A clean repo with small commits says more about how you work than a resume bullet.

For a bigger project Maven or Gradle is expected; for a first jar the plain javac and jar commands are enough and show you understand what the tool would do for you.

Terminal
javac -d out $(find src -name '*.java')
jar cfe app.jar Main -C out .
java -jar app.jar

git init && git add . && git commit -m "Console student report"
git remote add origin <url> && git push -u origin main

Worked example

javac -d out src/*.java then jar cfe app.jar Main -C out . gives one file; java -jar app.jar runs it anywhere Java is installed.

Your practice task

Build a runnable jar for your console app, write the README, and push it to GitHub.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

Interviewers rarely run your code, but the README and the commit history are read.

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.

Next recommended course Python for Absolute Beginners