Free degree-level programming lessons for careful independent study.

Degree Level Programmes · Programming 1 · Lesson 1

Java Portfolio Setup

Install and organise a Java workspace, run a first program and start a reflective portfolio.

Lesson Overview

Install and organise a Java workspace, run a first program and start a reflective portfolio.

Portfolio focus: Create a Java project with a README, src folder and notes file.

ConceptStarting the portfolio
Run fileJavaPortfolioSetupDemo.java
BaselineHello, portfolio The editor and Java runner are connected.
Evidence3 tasks

Starter: think before typing

Before running this starting the portfolio example, find the line where the main idea becomes active. Write a prediction: what must already be true for that line to work, and what should be different after it runs? The checked run ends with `Hello, portfolio The editor and Java runner are connected.`; predict how the focus line helps produce that evidence.

Learning Objectives

  • Create a reliable Java project folder structure.
  • Compile and run a simple Java program.
  • Explain what evidence belongs in a programming portfolio.
  • Write a short technical reflection on a first build.

Learning Outcomes

  • By the end of the lesson, you can create a reliable Java project folder structure.
  • By the end of the lesson, you can compile and run a simple Java program.
  • By the end of the lesson, you can explain what evidence belongs in a programming portfolio.
  • By the end of the lesson, you can write a short technical reflection on a first build.

Why this idea exists

Modern programming is not just typing instructions into an editor. It is an organised craft built around reproducibility: another person, or your future self, should be able to find the source code, run it, understand what changed and see why decisions were made.

This is why professional environments use project folders, version control, build tools, tests and notes. These practices developed as software moved from short single-person scripts to long-lived systems maintained by teams over years.

A portfolio makes that process visible. At degree level, the artefact is not only the finished program; it is the evidence that you can set up a disciplined workflow, solve problems methodically and explain your own development decisions.

Deep dive

Mechanism in this example

The important mechanism is visible around `System.out.println("The editor and Java runner are connected.");`. Read it as a concrete move in the program, not as decorative syntax: identify what value, object, branch, call or boundary is being created at that point.

Design pressure

A portfolio makes that process visible. At degree level, the artefact is not only the finished program; it is the evidence that you can set up a disciplined workflow, solve problems methodically and explain your own development decisions.

Failure mode to watch

For Java Portfolio Setup, deliberately disturb the assumption behind `System.out.println("The editor and Java runner are connected.");`: use an awkward value, missing input, wrong order of calls or boundary case. The useful question is how that disturbance exposes a weakness in the starting the portfolio design.

Extension step

Extend the example by doing this: Run a hello-world program from the IDE and from a terminal if available. The point is to make one small change that forces you to revisit the concept, rather than adding unrelated features.

Portfolio standard

The portfolio note should not repeat the lesson wording. It should show the edited code, the run result, and your own explanation of this evidence: add a short reflection explaining one setup problem and how you solved it.

Lesson visual

A labelled laptop workspace with Java IDE, terminal, source folder, test folder and reflective notebook arranged on a real desk.
A labelled laptop workspace with Java IDE, terminal, source folder, test folder and reflective notebook arranged on a real desk.Download visual

Type this and run it

Create JavaPortfolioSetupDemo.java, type the program, and run it before changing anything. This section is about reproducing the checked baseline.

public class JavaPortfolioSetupDemo {
  public static void main(String[] args) {
    System.out.println("Hello, portfolio");
    System.out.println("The editor and Java runner are connected.");
  }
}

Build and run it with:

javac JavaPortfolioSetupDemo.java && java JavaPortfolioSetupDemo

Expected baseline: Hello, portfolio The editor and Java runner are connected.

Run the code in your browser

Use the editor as an experiment surface. First run the checked version, then make one small change to the part of the program that demonstrates starting the portfolio and compare the new behaviour with the reference output.

Line-by-line explanation

Read the code as a sequence of responsibilities. The focus line for this lesson is System.out.println("The editor and Java runner are connected.");; the surrounding lines prepare it, use its result or make the behaviour observable.

public class JavaPortfolioSetupDemo {

This names the runnable class for the Java Portfolio Setup example, giving the compiler and JVM one clear unit to build.

public static void main(String[] args) {

This is the program entry point. In Java Portfolio Setup, it keeps the demonstration of starting the portfolio in one traceable starting script.

System.out.println("Hello, portfolio");

This prints "Hello, portfolio" as the observable evidence for Java Portfolio Setup. The output lets the learner check whether the starting the portfolio idea behaved as predicted.

System.out.println("The editor and Java runner are connected.");

This prints "The editor and Java runner are connected." as the observable evidence for Java Portfolio Setup. The output lets the learner check whether the starting the portfolio idea behaved as predicted.

}

This closes the innermost Java Portfolio Setup block, so the immediately preceding method, branch or loop has finished.

}

This closes the outer Java Portfolio Setup structure, returning the reader to the surrounding class or file.

Worked example

From code to explanation

Problem: Use Java Portfolio Setup to complete a small portfolio-quality step: Create a Java project with a README, src folder and notes file.

Method: Locate the line `System.out.println("The editor and Java runner are connected.");`, explain the exact role it plays, then decide what you would change to extend the example without changing the whole program.

Reveal worked answer

The checked run should produce `Hello, portfolio The editor and Java runner are connected.`. A strong answer links the result back to starting the portfolio: what was created, selected, stored, called or protected, and why that matters for the portfolio task.

Trace the program

Before: Before the key operation, identify the relevant value, object, branch or resource that the starting the portfolio concept depends on.

During: Trace `System.out.println("The editor and Java runner are connected.");` as the Java Portfolio Setup example executes. Say whether that operation creates data, checks a condition, calls behaviour, stores information or crosses a boundary.

After: Compare the run with the expected evidence: `Hello, portfolio The editor and Java runner are connected.`.

Change: Now run a hello-world program from the ide and from a terminal if available, run again, and explain the smallest reason the behaviour changed.

Common misconception

A common mistake in java portfolio setup is treating the example as a finished answer. For starting the portfolio, the important question is narrower: which operation carries the idea, what does it make possible, and what would break if you changed it carelessly?

Quick checks

1. In this Java Portfolio Setup example, what is the best reason to focus on `System.out.println("The editor and Java runner are connected.");`?

2. Which evidence is strongest after you edit and rerun this example?

How to study this lesson

For Java Portfolio Setup, predict how starting the portfolio changes the run before you press Run.

Use the first portfolio task as your main edit: Create a Java project with a README, src folder and notes file.

Use the second task as your variation: Run a hello-world program from the IDE and from a terminal if available.

Finish with evidence, not a diary entry: Add a short reflection explaining one setup problem and how you solved it.

Portfolio Practice

  1. Create a Java project with a README, src folder and notes file.
  2. Run a hello-world program from the IDE and from a terminal if available.
  3. Add a short reflection explaining one setup problem and how you solved it.

Final self-check

Can you explain the key operation?

Explain the line identified in the quick check in one or two sentences. Your answer should say what it does before the output Hello, portfolio The editor and Java runner are connected. appears.

Can you justify the portfolio evidence?

Your evidence should include the original run, one edited run, and a short note explaining how the edit affected starting the portfolio.

Study route

Practise starting the portfolio by predicting the Java example, typing it, running it in the browser, tracing the result and saving portfolio evidence.

Next, move into The Appropriate Programmer and carry forward one improvement from this lesson into the next program.