1. <i id='Ij9L2'><tr id='Ij9L2'><dt id='Ij9L2'><q id='Ij9L2'><span id='Ij9L2'><b id='Ij9L2'><form id='Ij9L2'><ins id='Ij9L2'></ins><ul id='Ij9L2'></ul><sub id='Ij9L2'></sub></form><legend id='Ij9L2'></legend><bdo id='Ij9L2'><pre id='Ij9L2'><center id='Ij9L2'></center></pre></bdo></b><th id='Ij9L2'></th></span></q></dt></tr></i><div id='Ij9L2'><tfoot id='Ij9L2'></tfoot><dl id='Ij9L2'><fieldset id='Ij9L2'></fieldset></dl></div>
    1. <tfoot id='Ij9L2'></tfoot>
      <legend id='Ij9L2'><style id='Ij9L2'><dir id='Ij9L2'><q id='Ij9L2'></q></dir></style></legend>
      • <bdo id='Ij9L2'></bdo><ul id='Ij9L2'></ul>

      <small id='Ij9L2'></small><noframes id='Ij9L2'>

      编译时如何通配符包含 JAR 文件?

      时间:2023-09-27

      <small id='qpr2U'></small><noframes id='qpr2U'>

      <i id='qpr2U'><tr id='qpr2U'><dt id='qpr2U'><q id='qpr2U'><span id='qpr2U'><b id='qpr2U'><form id='qpr2U'><ins id='qpr2U'></ins><ul id='qpr2U'></ul><sub id='qpr2U'></sub></form><legend id='qpr2U'></legend><bdo id='qpr2U'><pre id='qpr2U'><center id='qpr2U'></center></pre></bdo></b><th id='qpr2U'></th></span></q></dt></tr></i><div id='qpr2U'><tfoot id='qpr2U'></tfoot><dl id='qpr2U'><fieldset id='qpr2U'></fieldset></dl></div>

        <tfoot id='qpr2U'></tfoot>

            • <bdo id='qpr2U'></bdo><ul id='qpr2U'></ul>

                  <tbody id='qpr2U'></tbody>
                <legend id='qpr2U'><style id='qpr2U'><dir id='qpr2U'><q id='qpr2U'></q></dir></style></legend>
              1. 本文介绍了编译时如何通配符包含 JAR 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

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

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

                import org.apache.mina.common.ByteBuffer;
                

                ByteBuffer 位于 JAR 文件中(当然具有正确的目录结构).该 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: 包 org.apache.mina.common 不存在
                导入 org.apache.mina.common.ByteBuffer;

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

                How can I include jar files in my project?

                推荐答案

                你的命令行是正确的,但是有一些注意事项:

                your command line is correct, but there are some considerations:

                • 您必须拥有 javac >= 1.6,因为只有在该版本中,编译器才会将*"解析为各种 JAR 文件.
                • 您必须运行 Windows,因为;"仅是该操作系统的路径分隔符(它在 Unix 上不起作用,Unix 上的路径分隔符是:").

                我假设 JAR 文件具有您所说的正确目录结构.

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

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

                上一篇:如何使用 javac 编译 java 包结构 下一篇:如何从 cmd 运行作为包一部分的 .class 文件?

                相关文章

                最新文章

                1. <legend id='FxHyr'><style id='FxHyr'><dir id='FxHyr'><q id='FxHyr'></q></dir></style></legend>

                  <i id='FxHyr'><tr id='FxHyr'><dt id='FxHyr'><q id='FxHyr'><span id='FxHyr'><b id='FxHyr'><form id='FxHyr'><ins id='FxHyr'></ins><ul id='FxHyr'></ul><sub id='FxHyr'></sub></form><legend id='FxHyr'></legend><bdo id='FxHyr'><pre id='FxHyr'><center id='FxHyr'></center></pre></bdo></b><th id='FxHyr'></th></span></q></dt></tr></i><div id='FxHyr'><tfoot id='FxHyr'></tfoot><dl id='FxHyr'><fieldset id='FxHyr'></fieldset></dl></div>
                    <tfoot id='FxHyr'></tfoot>

                    <small id='FxHyr'></small><noframes id='FxHyr'>

                      <bdo id='FxHyr'></bdo><ul id='FxHyr'></ul>