IntelliJ Doesn't Properly Import Jars

Viewed 41380

I'm using IntelliJ 11.1.3 and I'm trying to attach two external libraries in the form of jarfiles to use in a module. I've added them in project structure -> module -> dependencies and they show up correctly under libraries as well, but I can't import them in my source code.

Is there a step I'm missing here? I'm pretty new to IntelliJ, having used Netbeans exclusively before, so I'm a little lost. I thought it would be simple enough to attach the external libraries and use the classes immediately, but I don't even get the library names on code completion when I type 'import'.

8 Answers

In my case, when I compiled .jar file in POM.xml have a code wich produce EXECUTABLE .jar, but for use .jar with role library in other application must be NOT EXECUTABLE .jar(it have not main.claass and etc. it is not must for us). Actually when I erase this cod from POM.xml - my library start working very well.

-->
<!--                <groupId>org.springframework.boot</groupId>-->
<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
<!--                <configuration>-->
<!--                    <excludes>-->
<!--                        <exclude>-->
<!--                            <groupId>org.projectlombok</groupId>-->
<!--                            <artifactId>lombok</artifactId>-->
<!--                        </exclude>-->
<!--                    </excludes>-->
<!--                </configuration>-->
<!--            </plugin>-->
Related