How to fix Commons Lang “Package Does Not Exist” Error

Tremaine Eto
Jan 5 · 1 min read
Image for post
Image for post

If you’re here, then you probably were met with a Java stack trace that has lines similar to this in it:

package org.apache.commons.lang does not exist...static import only from classes and interfaces

I saw this in a few Spring Boot applications with Maven, and the good news is that the fix should be easy.

The fix

import static org.apache.commons.lang

Then, replace all instances of that with the following:

import static org.apache.commons.lang3

Example

import static org.apache.commons.lang.StringUtils.isBlank;
import static org.apache.commons.lang.StringUtils.isNotBlank;

Simply put a 3 after lang. Your final import statements will then look like this:

import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;

Your app should now build.

Why?

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Sign up for Best Stories

By Dev Genius

The best stories sent monthly to your email. Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Tremaine Eto

Written by

Full-time software engineer since 2016. UCLA Computer Science B.S. with Atmospheric and Oceanic Sciences minor, class of ‘16.

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Tremaine Eto

Written by

Full-time software engineer since 2016. UCLA Computer Science B.S. with Atmospheric and Oceanic Sciences minor, class of ‘16.

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store