How to Use 3rd Party JAR in Java Project

by JAUER   Last Updated August 13, 2019 20:01 PM - source

I'm working on a basic Java project to make me more comfortable with the language (I've just started learning), and have come across a problem when trying to use a 3rd party library - I'm trying to use Apache's Lang library. I'm not using Eclipse to write my program, which I believe has a tool which makes it easy to use 3rd party libraries, so I'm not sure how I can use this library. When I try to use it, the 2 errors I receive are 'error: package org.apache.commons.lang3 does not exist', and 'error: cannot find symbol' on the line in which I call the StringUtils class (part of the Lang library). How can I use the library? (I am definitely a beginner in Java).

Tags : java libraries


Answers 1


What you're going to need to learn about is the Java classpath. In order to use a third party JAR, it needs to be on the classpath when executing your code.

Here is an excellent StackOverflow post which explains how to accomplish this.

varcharmander
varcharmander
August 13, 2019 20:34 PM

Related Questions




Create an exe using Jsmooth

Updated August 08, 2019 20:01 PM

How to use java Library Extern in Visual Studio Code

Updated January 16, 2019 13:01 PM

Error in finding libcaffe.so.1.0.0-rc3 in caffe

Updated July 27, 2017 13:01 PM