A deliberately small Java project for learning Java and Git.
The same clone opens as a real Java project in Eclipse, VS Code, or Cursor, on Windows or macOS, with no conversion step. Use whichever code IDE editor you like.
- Git
- JDK 21 or newer (Temurin / Adoptium is the usual free build). 21 is a long-term-support release, so it is the safe pick, but a newer JDK works too.
- One of:
- Eclipse IDE for Java Developers (2023-12 or newer — earlier releases do not know about Java 21)
- VS Code or Cursor, with the recommended Extension Pack for Java
Your IDE can do the clone for you — no ZIP download, and no git clone in a
terminal first. Every route below asks for the same clone URL:
https://github.com/benlambm/java-git-starter.git
- Start VS Code or Cursor with no folder open.
- Click Clone Repository. It is on the Welcome screen, and also in the Source Control panel in the left sidebar.
- Paste the clone URL above and press Enter.
- Pick the folder to clone into, then choose Open when it offers to open the result.
- Accept the pop-up recommending the Extension Pack for Java.
- Open
src/Main.javaand click Run above themainmethod.
- Check that Eclipse's Git support is installed: Help → About Eclipse IDE → Installation Details, then look for EGit. The "Eclipse IDE for Java Developers" package already includes it. If it is missing, install it from Help → Eclipse Marketplace… and search for EGit.
- File → New → Project…
- Expand Git, choose Projects from Git (newer releases label it Projects from Git (with smart import)), then Next.
- Choose Clone URI, then Next.
- Paste the clone URL above into URI. The host and path fields fill in by themselves. Next.
- Accept the defaults for the branch selection and the local destination folder, then Finish.
- Open
src/Main.javaand choose Run As → Java Application.
Eclipse imports the project in place, in the folder it just cloned into, rather than copying it into the workspace. That is what you want: your Git commits stay matched to the files you are actually editing.
The test/ folder holds 28 tests across seven files. Nothing there has a
main method — JUnit finds and runs the methods marked @Test for you.
All of them fail on a fresh clone. That is on purpose — see The six exercises below.
- Eclipse: right-click the
testfolder, or a single test file → Run As → JUnit Test - VS Code / Cursor: click the beaker icon in the left sidebar, or the arrow in the gutter next to a test method
src/edu/vwcc/itp220mod1/ holds six classes. Every class starts with an Instructions: comment saying exactly what its
method must do. The matching file in test/edu/vwcc/itp220mod1/ checks it.
| Class | What its method does |
|---|---|
FizzBuzz |
"Fizz", "Buzz", "FizzBuzz", or the number |
MovieTicketCalculator |
Ticket price from age, show hour, weekend |
HitDetection |
Is a click inside a rectangle? |
HealthBarDisplay |
Build a bar like [######----] 60% |
PasswordRuleChecker |
Does a password satisfy every rule? |
CaesarCipher |
Shift letters through the alphabet |
That order is roughly easiest to hardest, but you can work in any order.
One more stub lives outside that folder: Main.greet in src/Main.java,
checked by test/MainTest.java. Its javadoc is the spec — a blank or null
name falls back to "world", so greet("Ada") returns Hello, Ada!. Start
there if you want the smallest possible first win.
- Run the tests first. On a fresh clone all 28 fail. That is the correct starting point, not something you broke. Each failing test is one to-do item.
- Pick one class. Read its
Instructions:comment, then open its test file and read the exact values the tests expect. The tests are the precise version of the instructions. - Write the method body.
- Re-run just that one test class — right-click it → Run As → JUnit Test in Eclipse, or click the gutter arrow in VS Code / Cursor. Repeat until it is green.
- Move to the next class. Nothing here depends on anything else, so a class you have not started cannot break one you finished.
When a test fails, read the message before changing anything. JUnit tells you what it wanted and what it got:
expected: <Fizz> but was: <>
That one says your method returned an empty String where "Fizz" belonged.
You are finished when all 28 tests pass. That count includes the three in
test/MainTest.java covering Main.greet — the same shape of problem as the
six: a method that takes values in, returns a value out, and is tested
directly.