【发布时间】: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