【问题标题】:Recompiling jar files重新编译jar文件
【发布时间】:2016-12-05 21:56:38
【问题描述】:

试图将 jar 文件添加到我的 AndroidStudio 项目中。我得到一个很长的错误。我添加 jar 文件的原因是为了访问某些类。例如 SFTP 的能力,以及获取 PCM 文件并将采样率从 44100 更改为 16000。所以罐子是这样我可以导入以下内容:

com.jcraft.jsch.*;
com.jcraft.jsch.JSch;
com.jcraft.jsch.Session;
javax.sound.sampled.AudioFileFormat;
javax.sound.sampled.AudioFormat;
javax.sound.sampled.AudioInputStream;
javax.sound.sampled.AudioSystem;
javax.sound.sampled.UnsupportedAudioFileException;

但是在构建时我得到的这个错误的关键点是

warning: Ignoring InnerClasses attribute for an anonymous inner class
        (com.jcraft.jsch.Channel$1) that doesn't come with an
        associated EnclosingMethod attribute. This class was probably produced by a
        compiler that did not target the modern .class file format. The recommended
        solution is to recompile the class from source, using an up-to-date compiler
        and without specifying any "-target" type options.

我尝试过查找不同版本的 jar 文件,或者下载源代码以通过命令行重新编译。

如何构建一个项目来编译我可以在我自己的应用程序中使用的库?

如何从 jar 编译源代码,或者在哪里可以找到正确类型的 jar(如果是这样的话)。

【问题讨论】:

    标签: java android-studio jar


    【解决方案1】:

    您可能会从http://www.jcraft.com/jsch/ 获取源代码并自己编译 jar 文件。但是,我会首先检查您是否有可用的最新版本 - 这也可能解决您的问题。

    【讨论】:

      猜你喜欢
      • 2012-03-23
      • 2014-12-05
      • 2011-03-22
      • 1970-01-01
      • 2016-07-21
      • 2021-02-20
      • 1970-01-01
      • 2020-08-22
      • 2010-10-31
      相关资源
      最近更新 更多