J2SE com.google.zxing.client.j2se.MatrixToImageWriter 仍然是编写条形码的标准方法吗? [英] Is the J2SE com.google.zxing.client.j2se.MatrixToImageWriter still the standard way to write barcodes?

查看:134
本文介绍了J2SE com.google.zxing.client.j2se.MatrixToImageWriter 仍然是编写条形码的标准方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到有很多 2010 年左右的旧教程使用

I notice that there are a lot of old tutorials from about 2010 that use

com.google.zxing.client.j2se.MatrixToImageWriter

将二维条码写入文件.

另外,我注意到很多旧教程都指定使用 Android.

Also, I notice a lot of old tutorials specify the use of Android.

我在 Linux Mint 上使用 Eclipse,而不是 Android.

I am using Eclipse on Linux Mint, not Android.

Eclipse 将愉快地导入 java 文件的主 src 树并将它们显示为可用包.比如我可以把zxing/core/src/main/java下的所有包都显示出来;我可以从这些包中导入类并编译它们.

Eclipse will happily import the main src tree of java files and show them as available packages. For example, I can get all the packages under zxing/core/src/main/java to show up; I can import classes from those packages and compile them.

但是,当我导入核心包时,我似乎无法导入 com.google.zxing.client.j2se 包,反之亦然.

However, I can't seem to import the com.google.zxing.client.j2se package when I have the core packages imported, and vice versa.

如果有一种方法可以将 BitMatrix 对象写入文件而不使用

If there is a way to write BitMatrix objects to files without using

com.google.zxing.client.j2se

这会简化问题.

或者,如果有某种方法可以让 Eclipse 导入两组包,那可能是另一种选择.我已经尝试修改属性"选项卡下的过滤器",理论上如果我可以使用两个过滤器,第一个可以选择

Alternatively, if there is some way to get Eclipse to import both sets of packages, that might be an alternative. I have already tried modifying the "filters" under the "properties" tab, on the theory that if I can use two filters, the first can pick up

core/src/main/java

core/src/main/java

第二个可以接

/javase/src/main/java/

/javase/src/main/java/

但这对我不起作用.

欢迎提出建议.谢谢.

推荐答案

在导入时遇到了同样的问题.看来我们都忘了将 javase.jar 添加到项目中.从此处下载, 导入,您将能够导入 MatrixToImageWriter.

Ran into the same problem with the import. It appears that we both forgot to add the javase.jar into the project. Download it from here, import and you will be able to import MatrixToImageWriter.

这篇关于J2SE com.google.zxing.client.j2se.MatrixToImageWriter 仍然是编写条形码的标准方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆