qq_24983367
Nn_Wim
采纳率0%
2021-05-12 15:20 阅读 92
已结题

ubuntu16.04下jack-server服务跑不起来,android源码无法编译

100

1.在android源码目录下执行$ ./prebuilts/sdk/tools/jack-admin start-server命令,服务起不来。报如下错误:

Communication error with Jack server (35), try 'jack-diagnose' or see Jack server log

2.用jack-dagnose查看问题时,提示端口被占用

$ ./prebuilts/sdk/tools/jack-diagnose
error: process ID list syntax error

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
Port 8077 is used by another process (pid=), please ensure to free the port or change port configuration in '/home/lsy/.jack-settings' and '/home/lsy/.jack-server/config.properties'
error: process ID list syntax error

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
Port 8076 is used by another process (pid=), please ensure to free the port or change port configuration in '/home/lsy/.jack-settings' and '/home/lsy/.jack-server/config.properties'

我查看端口,只有这个jack-server在使用这个端口。端口信息如下:

$ lsof -i:8077
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    18736  lsy   29u  IPv6 292394      0t0  TCP localhost:8077 (LISTEN)

$ lsof -i:8076
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    18736  lsy   27u  IPv6 292388      0t0  TCP localhost:8076 (LISTEN)

3.home目录下的~/.jack-settings和~/.jack-server/config.properties文件中端口一致,且权限都是600。

文件权限如下:
$ ls -l .jack
-rw------- 1 lsy lsy 283 5月  12 14:02 .jack

$ ls -l .jack-settings
-rw------- 1 lsy lsy 134 5月  12 14:38 .jack-settings

$ ls -l .jack-server/config.properties
-rw------- 1 lsy lsy 284 5月  12 14:38 .jack-server/config.properties


.jack-settings端口使用情况如下:
~$ cat .jack-settings
# Server settings
SERVER_HOST=127.0.0.1
SERVER_PORT_SERVICE=8076
SERVER_PORT_ADMIN=8077

# Internal, do not touch
SETTING_VERSION=4

config.properties端口使用情况如下:
$ cat .jack-server/config.properties
#
#Wed May 12 13:55:29 CST 2021
jack.server.max-jars-size=104857600
jack.server.max-service=4
jack.server.service.port=8076
jack.server.max-service.by-mem=1\=2147483648\:2\=3221225472\:3\=4294967296
jack.server.admin.port=8077
jack.server.config.version=2
jack.server.time-out=7200

4.查看jack-server的log没有报错。log信息如下:

$ cat jack-server-0-0.log
14:39:14.400: INFO: com.android.jack.server.JackHttpServer: Starting jack server version: 1.3-a8 '1.3' (291201 fcd657165d2fd6dcf1bf4c3002c9c8f75383e815 by android-jack-team@google.com)
14:39:14.417: INFO: com.android.jack.server.JackHttpServer: Starting service connection server on /127.0.0.1:10000
14:39:14.420: INFO: com.android.jack.server.JackHttpServer: Starting admin connection on /127.0.0.1:10001
14:39:14.503: INFO: com.android.jack.server.JackHttpServer: Start timer

不知道什么情况,jack-server跑不起来,按照网上换端口~/.jack-settings和~/.jack-server/config.properties文件中端口设成一致,jack-server还是起不来,哪位大神帮忙解答下。

  • 点赞
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • usecf usecf 2021-05-12 16:28

    我之前遇到的是多个人用同一个服务器编译,导致端口被占用了,

    先按网上的配置下jack server

    然后删除out路径的文件,重启服务器重新编译就好了

    点赞 评论 复制链接分享
  • usecf usecf 2021-05-12 17:07

    你把jack servre的端口重新配置成其他的  重启下服务器试试

     

    点赞 评论 复制链接分享
  • usecf usecf 2021-05-12 17:29

    把jack server端口不变 重新删掉 配置下

    点赞 评论 复制链接分享
  • qq_24983367 Nn_Wim 2021-05-12 19:11

    最终临时方案,参考别人的方法,java用的openjdk1.8,在prebuilts/sdk/tools/jack-admin文件中添加openjdk1.7修改如下:

    -      JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -cp $LAUNCHER_JAR $LAUNCHER_NAME"
    +      JACK_SERVER_COMMAND="/usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -cp $LAUNCHER_JAR $LAUNCHER_NAME"

    如果谁有更好的方法,欢迎留言一起讨论。 

    点赞 评论 复制链接分享

相关推荐