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 in Java by Dustin
50 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 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,880 points
58 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,880 points
263 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 parth295
• 4,640 points
1,143 views
+2 votes
10 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
28,050 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,540 points
845 views
+2 votes
10 answers

How to import a jar file in Eclipse?

To import jar file in your Eclipse ...READ MORE

answered May 15, 2018 in Java by sharth
• 3,350 points
70,086 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,150 points
244 views
0 votes
1 answer
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 in Java by Sirajul
• 37,480 points
93 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 in Java by Sirajul
• 37,480 points
371 views