java如何引用第三方包,如何在Java中使用第三方包

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 I can embed a media player in my GUI.

Usually, I can just import packages and classes, but is this possible with 3rd party packages? They have a .jar file to download at their website, are the packages stored in that? And if so, how do I go about using them in my own application?

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值