How to use 3rd party packages in Java

前端 未结 3 1630
既然无缘
既然无缘 2020-12-09 17:06

I\'m developping my first Java application which actually needs a 3rd party package and now I\'m lost as to how to actually use it. The packages I need are from VLCJ so that

3条回答
  •  爱一瞬间的悲伤
    2020-12-09 17:16

    You just need the third party JAR to be on your project's classpath. What IDE are you using? In Eclipse you would do:

    Go to Package Explorer window on the left. Select the Java project you are working on and right click. Click Properties. Then click Java Build Path. Click Add External Jars.

    Or you could modify your system wide CLASSPATH to include the JAR. Or you can do it on the command line e.g.

    java -classpath C:\java\thirdpartjars\thirdparty.jar MyProgram
    

    (you can use the argument with javac too).

    There are many ways to crack this nut.

提交回复
热议问题