jackyesind
jackyesind

Reputation: 3373

Intellij Module dependency . NoClassDefFound Error

I am using Intellij Idea 12.1.3 In that I have 2 modules.

In one(A) module I added the external jars and write one class which is using that external libraries. And in another module(B) I made a module dependency with the module(A).

When I trying to use the class in module A from Module B. It shows the error NoClassDefFound Error for external libraries but when I run that class in Module A it is working fine. How would I solve this issue.

Upvotes: 1

Views: 3037

Answers (3)

support_ms
support_ms

Reputation: 1933

If you have external modules, check that they added as library module

Upvotes: 0

Ruchira Gayan Ranaweera
Ruchira Gayan Ranaweera

Reputation: 35557

Right click on your Module B and go open module settings. click on Module in opening window.

Now you can see a tabular view. select dependency and click on (+) button in the right hand corner. Select jar or libraries. Then add your Module A and cleck ok.

Upvotes: 1

s.d
s.d

Reputation: 29436

Check the box in Export column of parent module's dependencies:

enter image description here

The child module can now access classes in parent module's jar dependencies.

Upvotes: 0

Related Questions