如何通配符在编译时包括JAR文件? [英] How to wildcard include JAR files when compiling?

查看:101
本文介绍了如何通配符在编译时包括JAR文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个java文件(MyRtmpClient.java)中有以下内容:

I have the following in a java file (MyRtmpClient.java):

import org.apache.mina.common.ByteBuffer;

ByteBuffer 具有适当的目录结构)。
该jar文件和其他我需要的是与.java文件在同一个目录。

and ByteBuffer is inside a JAR file (with the proper directory structure of course). That jar file and others I need are in the same directory as the .java file.

然后我编译与行:

javac -cp ".;*.jar" MyRtmpClient.java

但我得到的错误:


MyRtmpClient.java:3: package org.apache.mina.common不存在

import org.apache.mina.common.ByteBuffer;

如何在我的项目中包含jar文件?

How can I include jar files in my project?

推荐答案

但有一些注意事项:


  • 您必须具有javac> = 1.6,因为只有在该版本中,编译器将*解析为各种JAR文件。

  • 您必须运行Windows,因为;是该操作系统的路径分隔符(在Unix上不起作用,Unix上的路径分隔符为:)。

我假设JAR文件具有正确的目录结构。

I'm assuming that the JAR file has the proper directory structure as you stated.

这篇关于如何通配符在编译时包括JAR文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆