Reputation: 4371
I added to my project under lib
directory the jar of opencsv.
then, in intelliJ under Project Structure
-> Libraries
added the jar.
but, somehow intelliJ doesn't recognize it.
why is that?
Upvotes: 1
Views: 10593
Reputation: 402375
Libraries in the Project Structure dialog represent the global libraries that can be configured once and then used in multiple projects and modules. To make a library available for a module, add it to the module dependencies.
Upvotes: 2
Reputation: 5792
Don't go this way, create a maven project and it will solve many problems you haven't encountered yet :).
Click 'Finish' Replace the generated pom.xml with the following:
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>opencsvtst</groupId>
<artifactId>opencsvtst</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
Under src/main/java add your classes (the one with the main method probably) and use the opencsv library.
You will find the compiled jar within the target folder once you build the project.
Upvotes: 3