Adding Jar file to project

+1 vote
I imported a project from Github and ran it as a java application. It threw errors about a reference to "SystemUtils cannot be resolved to a variable" After some research I found that the app requiquirs SystemUtils class from org.apache.commons.lang3

I am still new to Eclipse, but added the JAR file to "Java Build Path" libraries. The name it shows for the library is what the file was downloaded as "commons-lang3-3.9.jar"  

Even though I do not see the import command in the project I downloaded, in example tutorials I see SystemUtils imported with "import org.apache.commons.lang.SystemUtils;" -- because I am new I do not know if I should create a directory with org/apache/commons/lang and then rename the jar file to be SystemUtils

I am sure there is an easy answer, but I have spent hours trying to figure out how to add the SystemUtils to the project I downloaded so I don't get the error "SystemUtils cannot be resolved to a variable"

Thank you!
Sep 4, 2019 in Java by Dustin
2,441 views
Can you mention the link to the github project?

1 answer to this question.

0 votes

Changing the JRE System Library might work. 

  • Right-click on your project
  • Select Build Path and then click Configure Build Path
  • Under Libraries tab JRE System Library

  • Then choose the Workspace default JRE option

answered Sep 4, 2019 by Esha

Related Questions In Java

0 votes
3 answers

Adding text to a file using Java

try { final Path ...READ MORE

answered Sep 6, 2018 in Java by Sushmita
• 6,910 points
1,087 views
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,910 points
10,057 views
0 votes
1 answer

How to run a JAR file in Java?

The command given below will help you ...READ MORE

answered Jun 1, 2018 in Java by Parth
• 4,630 points
7,113 views
+2 votes
13 answers

Unable to execute jar- file: “no main manifest attribute”

add a jar/manifest/attributes setting like this: apply plugin: ...READ MORE

answered Nov 27, 2018 in Java by krishti
213,638 views
0 votes
0 answers

Eclipse "Error: Could not find or load main class"

I have a project on my laptop ...READ MORE

May 7, 2022 in Java by narikkadan
• 63,420 points
1,631 views
0 votes
1 answer

Following error is occurring "Can't start Eclipse - Java was started but returned exit code=13"

There are combinations of Operating System, JDK ...READ MORE

answered Apr 19, 2018 in Java by Rishabh
• 3,620 points
2,717 views
+4 votes
11 answers

How to import a jar file in Eclipse?

Click on File > Import. The Import ...READ MORE

answered Aug 23, 2018 in Java by Daisy
• 8,120 points
350,975 views
0 votes
1 answer

Which is the best GUI designer for Eclipse?

Windows Builder Pro is the best GUI ...READ MORE

answered May 21, 2018 in Java by Akrati
• 3,190 points
1,583 views
0 votes
2 answers

How to round any number to n decimal places in Java?

new BigDecimal(String.valueOf(double)).setScale(yourScale, BigDecimal.ROUND_HALF_UP); will get you a BigDecimal. To ...READ MORE

answered Aug 26, 2019 in Java by Sirajul
• 59,230 points
1,258 views
0 votes
2 answers

How can we add leading zeros to the number in Java?

From Java 1.5 you can use the String.format method. ...READ MORE

answered Aug 26, 2019 in Java by Sirajul
• 59,230 points
4,607 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP