Question

I am trying to import the JAR files of the Apache-Wink-1.3.0.

I downloaded the .zip file and extracted the content into a folder. In Eclipse I clicked Preferences - Java - Build Path - User Libraries - Import - Browse.

Now I navigated into the corresponding folder "lib" with all the JAR files in it.

Unfortunately, when trying to import ANY of those files, eclipse stats an error:

The selected file is not a valid user library data file

Is it the right way to import a library in eclipse?

BTW, I have Eclipse Juno, with Java EE. Shouldn't stuff like Apache-Wink be already included somewhere?

Was it helpful?

Solution

you can follow the next steps to custom a user lib in eclipse:

  1. open "Perference" dialog
  2. choice "User Libraries"

  3. click "new..." button, input the name of your user lib such as "Wink-lib"

  4. select the lib which you created. click "Add External JARS..." button. then selecte all jars of the Apache-Wink-1.3.0

you have create a user lib with the name you had input. then you can use it in any java project. use the step as follow:

  1. in "Package Explorer" view select a project which you want use the lib

  2. click the right button of you mouse, select "Properties" menu to open properties dialog

  3. in properties dialog, select "Java Build Path", select the "Libraries" tab, click "Add Library" to open a dialog.
  4. select "User Library" , then you can see the user library you added before. just select it. it's all!

OTHER TIPS

You should use "Add external JARs" instead. Lib is (in eclipse' terms) is not just a jar but probably several jars + appropriate definition.

Eclipse has it's custom format for user libraries - notice that in the Browse.. window for importing user library it is looking for *.userlibrary files only. I guess what you'd rather like to do is to either create a new user library and select these jars, or simply add jars directly to the build path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top