linux編譯jdk7時,遇到的坑
文章目錄
- 一、如何安裝
- 二、遇到的坑
- 2.1 Unsupported major.minor version 52.0
- 2.2 Checksum onbuild/jaxp/drop/bundles/jaxp145_01.zip is d41d8cd98f00b204e9800998ecf8427e, not 32394c780c8fb5e29775f623525993c0,
- 2.3 echo "*** This OS is not supported:" `uname -a`; exit 1;
- 2.4 C++11 requires a space between literal and string macro [-Werror=literal-suffix]
- 2.5 error: "__LEAF" redefined [-Werror]
- 2.6 error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated [-Werror=deprecated-declarations]
- 2.7 error: unable to find string literal operator 'operator""tag' with 'const char [58]', 'long unsigned int' arguments
- 2.8 error: cannot convert 'bool' to 'methodOop {aka methodOopDesc*}' in return if (cpool->cache() == NULL) return false; // nothing to load yet
- 2.9 /usr/bin/ld: cannot find -lstdc++;/usr/bin/ld: cannot find -ljvm
- 2.10 Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
- 三、參考文獻
一、如何安裝
跟著這個老哥做,它寫得很清晰。地址
二、遇到的坑
2.1 Unsupported major.minor version 52.0
原因:
ant-1.10.3需要jdk1.8的支援
解決辦法:
吧ant改為ant-1.7.1就行了(應該還有些版本也行)。
參考
2.2 Checksum onbuild/jaxp/drop/bundles/jaxp145_01.zip is d41d8cd98f00b204e9800998ecf8427e, not 32394c780c8fb5e29775f623525993c0,
原因:
發生這個問題時,我查看了所謂的jaxp145_01.zip,說的是zip可它根本就沒下載,而且是一個純文字的檔案。
我查了下,出現這個原因要嘛檔案被損壞了,要麼檔案被人篡改了。
解決辦法:
- 於是在/etc/profile下將下載改為了false:
export ALLOW_DOWNLOADS=false- 且設定了drop下來的包的路徑(你自己設,實現把所需要的包下下來)
export ALT_DROPS_DIR=/home/fengli/Downloads/MyOpenJdk7/drops- 我將需要的包下載來放在了/home/fengli/Downloads/MyOpenJdk7/drops目錄下。也就是這四個檔案:
我是參考這個網站搞的,參考
2.3 echo “*** This OS is not supported:” uname -a
; exit 1;
解決方法:
sudo vim openjdk/hotspot/make/linux/Makefile
註釋掉以下三行
#ifeq ( (EMPTY_IF_NOT_SUPPORTED),)
#$(QUIETLY) >&2 echo “*** This OS is not supported:”uname -a
; exit 1;
#endif
2.4 C++11 requires a space between literal and string macro [-Werror=literal-suffix]
https://github.com/konstantinmiller/dashp2p/issues/3
2.5 error: “__LEAF” redefined [-Werror]
https://www.jianshu.com/p/32dc1a850e23
2.6 error: ‘int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Werror=deprecated-declarations]
http://www.cnblogs.com/iou123lg/p/9696039.html
2.7 error: unable to find string literal operator ‘operator""tag’ with ‘const char [58]’, ‘long unsigned int’ arguments
http://mail.openjdk.java.net/pipermail/build-dev/2016-May/017170.html
2.8 error: cannot convert ‘bool’ to ‘methodOop {aka methodOopDesc*}’ in return if (cpool->cache() == NULL) return false; // nothing to load yet
2.9 /usr/bin/ld: cannot find -lstdc++;/usr/bin/ld: cannot find -ljvm
使用
這個問題在那個README裡面提到了,我查了一下,make時,用這個命令:
make STATIC_CXX=false
還不行的話,可以這樣試一下:
ld -lstdc++ -verbose
看是什麼原因,沒有.so連線,就加連線。
用
find /usr -name “lstdc++*”
檢視有那些滿足條件的檔案。
http://blog.sina.com.cn/s/blog_401aa0540101axrr.html
2.10 Failed to write core dump. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again
解決方法:
在命令列輸入 :ulimit -c unlimited
三、參考文獻
基本步驟
https://www.jianshu.com/p/32dc1a850e23
Unsupported major.minor version 52.0
https://groups.google.com/forum/#!topic/app-inventor-open-source-dev/qo1gX1SnR6U