Android 8.1 compilation error Jack server problem

Compile Android 8.1 and report errors related to Jack server
Jack server is an Android source code compilation tool. Used in Android 6.0 ~ Android 8.1 source code. Later versions are obsolete.

Error type 1:
communication error with Jack server (58), try ‘Jack diagnosis’ or see Jack server log
failed to contact Jack server: problem reading/home/user3 /. Jack server/client.pem. Try’ Jack diagnosis’

Error type 2:
Jack server failed to (RE) start, try ‘Jack diagnose’ or see Jack server log

Solution 1:

Open ~ /. Jack settings and ~ /. Jcak server/config.properties to change to other port numbers. Like 8976/8977
note that the two corresponding port numbers in the two files should be consistent


idea 2:
delete ~ /. Jack settings and ~ /. Jcak server/config.properties and recompile

Idea 3: JDK version problem
in my practice, openjdk1.8.0.292 will report that the port is occupied
the test method runs./prebuilds/SDK/tools/Jack diagnosis
printing the log will prompt that the port is occupied. For other unused ports, this is still the case
the solution is to use the JDK provided with the Android source code. Path: prebuilds/JDK/
you can also download other versions of openjdk, such as 1.8.0.141
uninstall the server JDK,
remove the openjdk (if installed). First, check which openjdk package is installed.

dpkg –list | grep -i jdk

To remove the openjdk package:

apt-get purge openjdk*

Check that all openjdk packages have been uninstalled:

dpkg –list | grep -i jdk

Configure the Android directory JDK to ~ /. Bashrc

export JAVA_ Home = {absolute path of your own Android source code} prebuilds/JDK/jdk8/Linux x86
export JRE_ HOME=

J

A

V

A

H

O

M

E

/

j

r

e

e

x

p

o

r

t

C

L

A

S

S

P

A

T

H

=

.

:

{JAVA_ HOME}/jre export CLASSPATH=.:

JAVAH​OME/jreexportCLASSPATH=.:{JAVA_ HOME}/lib:

J

R

E

H

O

M

E

/

l

i

b

e

x

p

o

r

t

P

A

T

H

=

.

:

{JRE_ HOME}/lib export PATH=.:

JREH​OME/libexportPATH=.:{JAVA_ HOME}/bin:$PATH

Effective changes:
source ~ /. Bashrc
recompile.

Read More: