Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – Black Friday 2026 – NPI EA – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

1. Overview

Classpath is an essential concept in the Java world. When we compile or start a Java application, the JVM finds and loads the classes in the classpath.

We can define the elements in the classpath either through the -cp option of the java/javac commands or through the CLASSPATH environment variable. No matter which approach we take to set the classpath, we need to follow the classpath syntax.

In this quick tutorial, we’ll discuss the classpath syntax, and particularly, the classpath separator on Windows and Linux operating systems.

2. The Classpath Separator

The classpath syntax is actually pretty straightforward: a list of paths separated by the path separators. However, the path separator itself is system-dependent.

While the semicolon(;) is used as the separator on Microsoft Windows systems, the colon (:) is used on Unix-like systems:

# On Windows system:
CLASSPATH="PATH1;PATH2;PATH3"

# On Linux system:
CLASSPATH="PATH1:PATH2:PATH3"

3. The Misleading Man Page on Linux

We’ve learned that the classpath separator can be different depending on the operating system.

However, if we take a closer look at the Java man page on Linux, it says the classpath separator is the semicolon (;).

For example, the man page of the java command from the latest(ver.17) OpenJDK shows:

–class-path classpath, -classpath classpath, or -cp classpath
A semicolon (;) separated list of directories, JAR archives, and ZIP archives to search for class files.
…

Also, we can find the exact text in the Oracle JDK‘s manual.

This is because Java is currently using the same manual content for different systems. A corresponding bug issue has been created earlier this year.

Moreover, Java has clearly documented that the path separator is system-dependent on the File class’s pathSeparatorChar field.

4. Conclusion

In this short article, we’ve discussed the classpath syntax on different operating systems.

Further, we’ve talked about a bug regarding the path separator in the Java man page on Linux.

We should keep in mind that the path separator is system-dependent. The colon is used on Unix-like systems, while on Microsoft Windows systems, the semi-colon is used.

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

Course – Black Friday 2026 – NPI EA – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW