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!
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.
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:
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.
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.
Project -> properties -> Java build path -> libraries -> add external jars
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With