Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a simple question about lib folder in Eclipse

Tags:

java

eclipse

I am new to Eclipse IDE, I created a new project named "Hello World", and I need some APIs which are contained in a jar file.

I created a folder called "lib" under the project folder "Hello World" (parallel with src folder), and I import the .jar file into this lib folder, it extracts all the things to this lib folder automatically.

Then I created my HelloWorld.java class under src folder, however, when I put import ro.xxx.xxx.xxx, eclipse complains "the import ro cannot be resolved". Actually, the ro is under the lib folder.

I am stuck here. Shall I make this lib folder under the src folder instead of parallel with it? Please kindly give me some suggestions, thanks in advance!

like image 348
Kevin Avatar asked Dec 10 '10 16:12

Kevin


People also ask

How to create user library in Eclipse IDE?

To create and add user library, follow the below steps. Step 1- Open the Eclipse IDE, click on the Window » Preferences. Step 2- From the Preferences window, click on the Java » Build Path » User Libraries. Step 3- Click on the New button and choose a suitable name for your user library, hit the OK button.

Where can I find the JAR files in Eclipse?

The JAR files contained within a user library are identified by an absolute file path external to the Eclipse workspace. It's helpful to have a consistent location for these libraries on your local or network file system. A library's files also might be located within a vendor product installation directory. We'll use the following file structure:

Why is eclipse considered to be an extensible IDE?

Answer: Eclipse is considered to be an extensible IDE as we can install several plug-ins in the IDE which in turn makes it so popular for development purposes. In the ‘About Eclipse’ Window, we can find all the “Installation Details” of it. If we click on the ‘Installation Details’, we can see the details of all the plug-ins installed in IDE.

How do I create a simple project in Eclipse?

Use the command File > New > Project > Simple Project. Uncheck the option to use a default project location within the workspace folder and enter the path for your \eclipse-contrib\libraries folder (see Figure 6-8 ). Figure 6-8 Create a new simple project with linked folder location.


1 Answers

Project -> properties -> Java build path -> libraries -> add external jars

like image 133
Stan Kurilin Avatar answered Sep 19 '22 15:09

Stan Kurilin