简体   繁体   English

使用javaxt时出错

[英]Error while using javaxt

I am having a problem when using javaxt in my android application. 我在Android应用程序中使用javaxt时遇到问题。

Basically what I did is, added the javaxt jar file as a library to my project and configured the build.gradle and the settings.gradle so the the javaxt jar file will be compiled. 基本上,我所做的是,将javaxt jar文件作为库添加到我的项目中,并配置了build.gradlesettings.gradle以便将javaxt jar文件进行编译。 In my java class I am importing the javaxt.io.Image and my actual code is the following: 在我的java类中,我正在导入javaxt.io.Image而我的实际代码如下:

Image image = new Image("/storage/extSdCard/gps/gps_001.jpg");
double[] gps = image.getGPSCoordinate();

When I am trying to build my project the build is failing and the error is the following: 当我尝试构建项目时,构建失败,错误如下:

Error:(200, 27) error: cannot access RenderedImage class file for java.awt.image.RenderedImage not found Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Error:Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

Anyone experiencing the same problem or have experienced the problem and solved it? 任何人遇到相同的问题或已经解决了问题?

Thanks for your help. 谢谢你的帮助。

Either your source code or your library uses java.awt.image.RenderedImage , which does not exist on Android. 您的源代码或库使用的java.awt.image.RenderedImage ,在Android中不存在。 javaxt.io.Image definitely refers to RenderedImage . javaxt.io.Image绝对引用RenderedImage

Note that there is no sign that the authors of this library offer Android compatibility. 请注意,没有迹象表明该库的作者提供了Android兼容性。 You may find it easier to solve your problem using a library known to work on Android. 您可能会发现使用已知可在Android上运行的库更容易解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM