LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do you install a java library? (https://www.linuxquestions.org/questions/linux-software-2/how-do-you-install-a-java-library-750239/)

mrbubblesort 08-25-2009 08:46 PM

How do you install a java library?
 
This should be an easy question answer, I just have very little experience with java.

I'm on Solaris, and I just downloaded the SNMPJ4 http://www.snmp4j.org/ java library, but it has absolutely no installation instructions. There's a .jar file in the package, so I tried
Code:

java -jar /dist/lib/SNMP4J.jar
but it says
Code:

Failed to load Main-Class manifest attribute from SNMP4J.jar
There's also a build.xml file in the package, but I have no clue what to do with that. Do I have to run a command to install it, do I just copy the jar file to some directory, or do I do something else perhaps?

crabboy 08-25-2009 09:33 PM

With java .jar files no installation is really necessary. It needs to be put in the CLASSPATH of what ever needs to call into it.

The build.xml file is an ant build script. if you have ant installed you can type ant in the directory where the build.xml is and it will run it.

mrbubblesort 08-26-2009 12:42 AM

Thank you very much! I just set my classpath to the directory with the .jar file and it worked like a charm.


All times are GMT -5. The time now is 10:44 PM.