Install Java Libraries

Since I am completely new to Java, I would like to know the correct procedure for installing new libraries (those that are not available in my linux dist repositories). Where should I place them? and how to install them? For example, I downloaded openCsv ( http://opencsv.sourceforge.net/ ) and I have no idea how to install it.

+3
source share
5 answers

Java libraries do not have to be β€œinstalled” like other applications. All you have to do is put the jar file in a specific place and add the jar file to your class path. How you do this depends on the Linux distribution you are using. If you are creating a web application in eclipse, you can delete the .jar file in the WebRoot / web-inf / lib folder and it will be associated with your project.

+3
source

Make sure that the path where you put the libraries is set in the $ CLASSPATH Environment variable.

For Eclipse: Project -> Properties -> Java Build Path -> Add JAR ...

+4
source

- /opt/javalib, /usr/local.

+2

, . JRE, .

( - , ) , lib/. , (Ant ..), ( Maven, - src/main/resources)

+1

Maven . Maven JAR ( ).

, , Maven .

Beware: Maven is something you can get used to, and the initial learning curve is steep. Rewards are received if everything is set up correctly for you, and maven takes care of compilation, packaging, distribution, website development, release management, etc. Etc. Etc.

+1
source

Source: https://habr.com/ru/post/1787153/


All Articles