将comm.jar添加到我的jar中 [英] Adding comm.jar into my jar

查看:195
本文介绍了将comm.jar添加到我的jar中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 comm.jar 库添加到我的 .jar 中,我得到 javax。 comm.NoSuchPortException

I add comm.jar library into my .jar and I get javax.comm.NoSuchPortException.

这个错误是因为我没有添加 javax.comm.properties win32com.dll 进入我的jar?如何在清单中添加此文件?

Is this bug because I haven't add javax.comm.properties and win32com.dll into my jar? How can I add this file inside manifest?

推荐答案

Java不支持Jars中的Jars。确保 javax.comm 包在应用程序的运行时类路径上的正确方法是添加一个清单,该清单提供相关路径到依赖Jar,并确保Jar位于正确的位置。有关详细信息,请参阅使用清单文件:基础知识&特别是在Java教程中将类添加到JAR文件的类路径

Java does not support Jars within Jars. The correct way to ensure the javax.comm packages are on the run-time class-path of the application is to add a manifest that provides a relative path to the dependent Jar, and ensure that Jar is in the right place to be found. For details see Working with Manifest Files: The Basics & particularly Adding Classes to the JAR File's Classpath in the Java Tutorial.

还有其他方法可用于applet和app。使用Java Web Start启动。

There are other methods that can be used for applets and apps. launched using Java Web Start.

这篇关于将comm.jar添加到我的jar中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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