user2355359
user2355359

Reputation: 37

Add a package properly to Eclipse

I trie to add a package to eclipse, i tried to put the folder in the com forlder but i still have an error

http://img11.hostingpics.net/pics/171845Capturede769cran20130511a768190030.png

Upvotes: 0

Views: 756

Answers (2)

AtulS
AtulS

Reputation: 1

  1. Go to Package Explorer
  2. Right Click on your project
  3. Select Build Path->Configure Build Path

Now you can Add other projects(from Projects Tab) in your current project build path to use their API's or you can add .jar (from Libraries Tab) to your current project.

To Add other Project into your current working project : a. Click on Projects Tab b. Click in Add c. select project/s that you want and Click on Ok.

To Add external .jars into your current working project : a. Click on Libraries Tab b. Click in Add External Jars c. select .jars that you want and Click on Ok. You can also select jars from other projects from your current workspace.

Upvotes: 0

Sky
Sky

Reputation: 709

Your screenshot looks like you want to use a library and don't know how to reference it from your project.

What you should do is:

  • Right click on the project MW K 1 in Eclipse
  • Then select Java Build Path
  • Then go to the tab Libraries
  • And add the library which you want to use (in most cases that's a .jar file).

This way your project will find the packages and classes which are located in this library and you will be able to use them in your project.

You should also be aware of the fact that in order to run your program, the library must be available at runtime, too.

Upvotes: 1

Related Questions