qazwsx
qazwsx

Reputation: 26898

How to use a "custom jar" in IntelliJ IDEA?

I'm trying to set up IntelliJ IDEA -- tried 12 and 13 -- Mac to use a Java class included a jar file for my Java application.

I've set the jar as a module dependency by the following procedure

However, after setting this, in a Java class file in my Java application, if I use a class defined in the custom jar file, it still prompts me "Cannot resolve symbol 'SomeClass'".

Any idea what I'm doing wrong and how to fix this?

Edit:

my settings:

enter image description here

enter image description here

BTW, the Libraries and Global libraries are both empty. I tried to set the two jars there (separately) and add them as dependencies for the Java app, and had no luck, so I deleted them from Libraries and Global libraries. The above setting is using add module dependency as files directly (without first registering them as libraries), which still does not work.

Upvotes: 3

Views: 834

Answers (1)

qazwsx
qazwsx

Reputation: 26898

Putting everything in the default unnamed package solved the issue.

Upvotes: 1

Related Questions