写在前面:
针对该问题,最好的解决方式,参考评论区给的最终解决方案。
配置文件中把TLS1.0跟TLS1.1的限制给去掉即可,修改/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security文件,去掉TLSv1,TLSv1.1即可,JAVA官网版本更新信息,链接:https://java.com/en/download/help/release_changes.html
-
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
-
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
-
include jdk.disabled.namedCurves
以下为个人踩坑记录。
1 背景
rk3399编译时,jack-admin总是报错,运行jack-admin start-server,之后,一直卡在连接状态,退不出来。查看report.xxx.txt,提示
$ JACK_EXTRA_CURL_OPTIONS=-v jack-admin list server
* Trying 127.0.0.1...
* TCP_NODELAY set
* connect to 127.0.0.1 port 8077 failed: Connection refused
* Failed to connect to 127.0.0.1 port 8077: Connection refused
2 尝试
参考网上例子,重装jack,改换端口,改jack-admin,所有能试的都试过了,仍然无法正常运行。
3 后来,在其它服务器上编译,是正常的,但是在prebuild/sdk/tools/下反复运行几次jack-admin xxx后,又会出现编译不过的问题了。
4 最后,发现是java1.8的版本升级了,之前的1.8的版本可能都没问题,只要升级了1.8.0_292这个版本就会出问题
yanhongfei@ubuntu:~/git_nct/RK3399System/RK3399-JD4-Android7.1/prebuilts/sdk/tools$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
5 卸载java
先检查是否安装,命令:sudo dpkg --list | grep -i jdk
移除openjdk包,命令:sudo apt-get purge openjdk*
卸载 OpenJDK 相关包,命令:sudo apt-get purge icedtea-* openjdk-*
有些没卸载完,命令:sudo apt autoremove
再次检查是否卸载成功,命令:sudo dpkg --list | grep -i jdk
卸载完成
6 安装java,由于阿里云上的jdk只有1.8.0_292的版本可以正常升级,但这个版本又有问题,于是设置为清华源
6.1 更新清华源,下载
更改/etc/apt/source.list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
6.1.1 更新源
yanhongfei@ubuntu:~$ sudo apt-get update
yanhongfei@ubuntu:~$ sudo apt-get upgrade #更新软件,一般不用调用
yanhongfei@ubuntu:~$ sudo apt-get autoremove
6.2 查找可用版本
yanhongfei@ubuntu:~$ sudo apt-cache madison openjdk-8-jdk
openjdk-8-jdk | 8u162-b12-1 | https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe amd64 Packages
6.3 安装对应版本
yanhongfei@ubuntu:~$ sudo apt-get install openjdk-8-jdk=8u162-b12-1
6.3.1如果提示依赖问题,则按提示安装对应的版本
yanhongfei@ubuntu:~$ sudo apt-get install openjdk-8-jre=8u162-b12-1
yanhongfei@ubuntu:~$ sudo apt-get install openjdk-8-jre-headless=8u162-b12-1
6.4 输入命令java -version,看到希望的java版本被设置。
yanhongfei@ubuntu:~/git_nct/RK3399System$ java -version
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
jack无法编译2.0版本
背景:
通过配置文件中把TLS1.0跟TLS1.1的限制给去掉,可解决在openjdk version "1.8.0_292"版本上的编译问题,在后期update后,java版本被升级到"1.8.0_312",又出现无法编译问题,未找到可行办法。于是重装jdk(有了之前的踩坑记录,这次就熟练多了)
1 卸载jdk
sudo apt purge -y openjdk-11-jre-headless
sudo apt purge -y openjdk-8-jre-headless
sudo apt purge -y default-jdk
2 重新安装指定版本
sudo apt-cache madison openjdk-8-jdk #查找可用版本,只有一个8u162-b12-1的较旧版本
sudo apt-get install openjdk-8-jdk=8u162-b12-1
sudo apt-get install openjdk-8-jre=8u162-b12-1
sudo apt-get install openjdk-8-jre-headless=8u162-b12-1
sudo apt-get install openjdk-8-jdk-headless=8u162-b12-1
注意, java, javac -version版本要一致
默认切换到使用opendjk8
sudo update-alternatives --config java
sudo update-alternatives --config javac
3 重新运行jack-admin start-server仍然无法运行、
查看.jack-server/logs下的,发现错误 “Failed to setup ssl context”,怀疑是jack-admin server需重新安装,于是
4重新安装jack-server
4.1删除jack-server
./jack-admin uninstall-server
rm ~/.jack-settings
4.2安装
./jack-admin install-server jack-launcher.jar jack-server-4.8.ALPHA.jar
3 重新运行jack-admin start-server, 成功
备注:若想继续用292,可以参考后续调试记录6
4 禁止自动升级
修改配置文件/etc/apt/apt.conf.d/10periodic。
将“1”改为“0”,保存即可。
$vim /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0"
5 make时,出错:ninja: error: 'out/target/common/obj/APPS/TeleService_intermediates/classes.noshrob.jack', needed by
'out/target/common/obj/APPS/TeleServiceTests_intermediates/jack.check.timestamp', missing and no known rule to make it
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
原因是当时为了屏蔽TeleService.apk,修改了Telephony/Android.mk,造成首次编译不通过,可以编译完了再改
修改RK3399-JD4-Android7.1/packages/services/Telephony/Android.mk,更改名字,使其不编译(注意,首次编译可能会不通过,可以编译完了再改)
#LOCAL_PACKAGE_NAME := TeleService
LOCAL_PACKAGE_NAME := BackTeleService
其实正确方式应该在PRODUCT_DEL_PACKAGES中添加TeleService,注意,在make前,先make installclean一下
PRODUCT_PACKAGES += \
Telecom \
TelephonyProvider \
MmsService
PRODUCT_DEL_PACKAGES += \
Music \
Calendar \
Contacts \
LiveTv \
Email \
DeskClock \
QuickSearchBox \
DocumentsUI \
TvSettings \
Launcher3 \
Launcher2 \
TeleService
6 纠结292版本。。。(最终是直接拷贝实现)
1 如想继续用292的source.list,可将原有包含有292版本的/etc/apt/sources.list替换为本机/etc/apt/sources.list
2 更新仓库
,然而更新,仍是162的版本,仓库 内无法找到292的版本,可手动拷贝压缩292的版本,
sudo apt-get update
备注: 添加openjdk仓库和删除仓库指令
sudo add-apt-repository ppa:openjdk-r/ppa
sudo add-apt-repository --remove ppa:openjdk-r/ppa
3 拷贝292版本
3.1 压缩292版本
yanhongfei@ubuntu:/usr/lib/jvm$ sudo tar -jcvf ../1.8.0.292_rk3399.tar.bz2 java-8-openjdk-amd64 java-1.8.0-openjdk-amd64
3.2 拷贝并解压
yanhongfei@ubuntu:/usr/lib/jvm$ sudo tar -xvjf 1.8.0.292_rk3399.tar.bz2
3.3 export
yanhongfei@ubuntu:~/Workspace/RK3399System_self$
yanhongfei@ubuntu:~/Workspace/RK3399System_self$ export LC_ALL=C
yanhongfei@ubuntu:~/Workspace/RK3399System_self$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
yanhongfei@ubuntu:~/Workspace/RK3399System_self$ export PATH=$JAVA_HOME/bin:$PATH
yanhongfei@ubuntu:~/Workspace/RK3399System_self$ export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
yanhongfei@ubuntu:~/Workspace/RK3399System_self$
yanhongfei@ubuntu:~/Workspace/RK3399System_self$
yanhongfei@ubuntu:~/Workspace/RK3399System_self$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
yanhongfei@ubuntu:~/Workspace/RK3399System_self$ javac -version
javac 1.8.0_292
版本链接:已去掉TLSv1,TLSv1.1,可直接使用