简体   繁体   English

在Eclipse中使用Processing Library

[英]Using a Processing Library in Eclipse

I am trying to use a MySQL library in Eclipse. 我试图在Eclipse中使用MySQL库。 I have imported the jar file and added the source location and it looks ok, I don't get any error messages in the editor. 我已导入jar文件并添加了源位置,看起来没问题,我在编辑器中没有收到任何错误消息。 The problem is I get an error when I run the code. 问题是我运行代码时出错。 I can run the same code in Processing with no problem so I think something is wrong with how I imported the library. 我可以在Processing中运行相同的代码而没有问题所以我认为我导入库的方式有问题。 I have managed to use the Processing library in Eclipse so I thought there'd be no problem. 我已经设法在Eclipse中使用Processing库,所以我认为没有问题。

This is the error I get: 这是我得到的错误:

在此输入图像描述

It says NoSuchMethodError for line 26. I've checked the methods involved in the MySQL constructor and I can see them and open them in the package explorer, it doesn't look like anything is missing. 它说第26行的NoSuchMethodError。我检查了MySQL构造函数中涉及的方法,我可以看到它们并在包资源管理器中打开它们,看起来没有任何遗漏。

I'm using BezierSQLib and I downloaded it from Github here: https://github.com/fjenett/sql-library-processing 我正在使用BezierSQLib,我从Github下载它: https//github.com/fjenett/sql-library-processing

I think something is wrong with how I imported the library. 我认为导入库的方式有问题。

I doubt this is the problem. 我怀疑这是问题所在。

The error is telling you that the SQL Library is looking for a function called registerDispose() in Processing, but your version of Processing doesn't have it. 该错误告诉您SQL库正在处理一个名为registerDispose()的函数,但您的Processing版本没有它。

The registerDispose() function was deprecated in Processing 2 and removed in Processing 3, so it's not surprising that the library can't find it. registerDispose()函数在处理2中已弃用,在处理3中已删除,因此库无法找到它也就不足为奇了。

So it looks like you're using an old version of the library, since the GitHub page says it supports Processing 3. I'd try making sure you're using the latest versions of both the library and Processing. 所以看起来你正在使用旧版本的库,因为GitHub页面说它支持Processing 3.我会尝试确保你使用库和Processing的最新版本。

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

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