Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 Netbeans7.1 中开发一个应用程序。在构建应用程序后,我面临一个从应用程序添加新 jar 文件的问题。
据我所知,当我们在 Netbeans 中构建项目时,它将创建一个“jar”文件和“lib”目录(其中包含应用程序中使用的所有库)到“dist”目录中。
问题是,我必须/lib/在构建项目后将应用程序中的新 jar 添加到目录中。这样该 jar 将在应用程序中使用。我该怎么做?
/lib/
如果你有一个成功的构建,那么这意味着jar你想要添加的内容是在运行时而不是在编译时需要的,否则它不会被编译。如果是上述情况,添加 jar 很简单。
jar
rar
META-INF
lib/new_jar_file.jar
这是MAINIFEST.MF文件的屏幕截图,红色框显示了添加上述行的位置。