user674052
user674052

Reputation: 106

How do I determine where a package is being referenced from in Eclipse?

I have two different copies of an open source project, one that builds and one that doesn't. The one that doesn't build is saying:

Description Resource    Path    Location    Type
The project was not built since its build path is incomplete. Cannot find the class file for javax.crypto.SecretKey. Fix the build path then try building this project  Server      Unknown Java Problem
The type javax.crypto.SecretKey cannot be resolved. It is indirectly referenced from required .class files  DefaultConfigurationController.java /Server/src/com/mirth/connect/server/controllers    line 1  Java Problem

and these two classes have been highlighted by eclipse

import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;

In the project that builds, how do I determine where it is resolving these references from?

Upvotes: 1

Views: 3752

Answers (4)

Md. Naushad Alam
Md. Naushad Alam

Reputation: 8461

This is very silly error, i solved this by following way...

Right click on projcet->properties->Java Build Path.

Now select Libraries tab and press Add Library then select JRE System Library->next->Finish.

Now all errors will gone.

Upvotes: 1

RLZaleski
RLZaleski

Reputation: 636

Ctrl+click the class name either from the import or a usage.

The used file should show up in a new editor window (with or without source)

Right Click the editor window, Show in -> Project Explorer

It'll select the file from the jar/lib it's in in the explorer, you can scroll up in the window if needed to see what lib / jar it came from.

Upvotes: 0

Duncan
Duncan

Reputation: 763

Probably the quickest/easiest way is to right-click on the project and go to:

Build Path | Add External Archives...

I think you're after "jce.jar", which is found in the "lib" folder of your JDK - browse to this folder and add the jar.

A slightly more elegant way is to use the following:

Build Path | Add Libraries.. | User Library

Hope that helps.

Upvotes: 2

Wojciech Owczarczyk
Wojciech Owczarczyk

Reputation: 5735

Press F3 on the type of interest and press Link with editor in Package explorer view.

On the other hand if you would like to see all the references of a given class, field or method press Ctrl + Shift + G.

Upvotes: 6

Related Questions