IT lexicon › Programming › Classpath exception

Classpath exception

Programming På svenska → Updated: 2026-11-01

A rider on the GPL that lets programs link against a GPL library without becoming GPL themselves.

It was written for GNU Classpath, a free implementation of Java's standard class library. The problem was obvious: if every Java program that touched java.lang.String counted as a derivative work of a GPL library, no commercial Java shop would go near it. The fix was a clause stating that independent modules which merely link to the library may be licensed however their authors like, while changes to the library itself remain under copyleft.

The wording went mainstream in 2006–2007, when Sun released OpenJDK as "GPLv2 with the Classpath Exception". The same idea lives on in GCC's Runtime Library Exception of 2009, which is why binaries built with GCC don't inherit the compiler's licence. In effect it's a bespoke alternative to the LGPL, minus the LGPL's requirement that users be able to swap the library out.

← Back to the lexicon