博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux环境下编译不成功
阅读量:4051 次
发布时间:2019-05-25

本文共 4613 字,大约阅读时间需要 15 分钟。

[hadoop@hd2-single 01]$ javac -cp *.jar zxing_test/Test.java 

zxing_test/Test.java:12: package com.google.zxing.client.j2se does not exist

import com.google.zxing.client.j2se.*;

^

warning: com/google/zxing/BarcodeFormat.class(com/google/zxing:BarcodeFormat.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/BinaryBitmap.class(com/google/zxing:BinaryBitmap.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/DecodeHintType.class(com/google/zxing
ecodeHintType.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/LuminanceSource.class(com/google/zxing:LuminanceSource.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/MultiFormatReader.class(com/google/zxing:MultiFormatReader.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/MultiFormatWriter.class(com/google/zxing:MultiFormatWriter.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/Reader.class(com/google/zxing:Reader.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/ReaderException.class(com/google/zxing:ReaderException.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/Result.class(com/google/zxing:Result.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/common/BitMatrix.class(com/google/zxing/common:BitMatrix.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/common/HybridBinarizer.class(com/google/zxing/common:HybridBinarizer.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

error: Class names, 'javase.jar', are only accepted if annotation processing is explicitly requested

zxing_test/Test.java:38: cannot find symbol

symbol  : variable MatrixToImageWriter

location: class zxing_test.Test

            MatrixToImageWriter.writeToFile(byteMatrix, "png", file);  

            ^

zxing_test/Test.java:57: cannot find symbol

symbol  : class BufferedImageLuminanceSource

location: class zxing_test.Test

                        LuminanceSource source = new BufferedImageLuminanceSource(image);  

                                                     ^

warning: com/google/zxing/common/GlobalHistogramBinarizer.class(com/google/zxing/common:GlobalHistogramBinarizer.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

warning: com/google/zxing/Binarizer.class(com/google/zxing:Binarizer.class): major version 51 is newer than 50, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

Note: zxing_test/Test.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

4 errors

13 warnings

[hadoop@hd2-single 01]$ ls

com  core.jar  javase.jar  META-INF  zxing_test  zxing_test.compiled.zip  zxing_test.jars.zip  zxing_test.src.zip

[hadoop@hd2-single 01]$ 


我在linux环境下怎么就是编译不成功啊?

编码问题我已经在努力克服了,转utf-8,unicode都试了,无BOM也试了啊。

结果发现:

linux下注意几点:
jdk版本一定要1.7以上,我是1.8.05;
一定要加上 -cp 参数和当前路径;
===我的操作结果如下:
[hadoop@hd2-single 01]$ java -cp *.jar:. zxing_test.Test
java -cp core.jar;javase.jar;zxing_test.jar Test param1 param2
        param1: 二维码图片需要包含的文字信息
        param2: 二维码图片输出路径
[hadoop@hd2-single 01]$ ls
a.png  com  core.jar  javase.jar  META-INF  zxing_test  zxing_test.compiled.zip  zxing_test.jar  zxing_test.jars.zip  zxing_test.src.zip
[hadoop@hd2-single 01]$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
[hadoop@hd2-single 01]$ java -cp *.jar:. zxing_test.Test aaaaaaaaaaaaaaaaaaaaaaaaaaaa a.png
成功生成二维码

转载地址:http://bfici.baihongyu.com/

你可能感兴趣的文章
Redis与Memcached的区别
查看>>
redis sharding方案
查看>>
程序员最核心的竞争力是什么?
查看>>
Node.js机制及原理理解初步
查看>>
linux CPU个数查看
查看>>
分布式应用开发相关的面试题收集
查看>>
简单理解Socket及TCP/IP、Http、Socket的区别
查看>>
利用HTTP Cache来优化网站
查看>>
利用负载均衡优化和加速HTTP应用
查看>>
消息队列设计精要
查看>>
分布式缓存负载均衡负载均衡的缓存处理:虚拟节点对一致性hash的改进
查看>>
分布式存储系统设计(1)—— 系统架构
查看>>
MySQL数据库的高可用方案总结
查看>>
常用排序算法总结(一) 比较算法总结
查看>>
SSH原理与运用
查看>>
SIGN UP BEC2
查看>>
S3C2440中对LED驱动电路的理解
查看>>
《天亮了》韩红
查看>>
Windows CE下USB摄像头驱动开发(以OV511为例,附带全部源代码以及讲解) [转]
查看>>
出现( linker command failed with exit code 1)错误总结
查看>>