blob: e9bc15e5dd268ea87d0b1fc90b21702703bb6496 [file] [log] [blame]
Yohann Roussele3f18c22016-02-24 16:16:42 +01001This documentation describes usage of Jack server 1.3-a8.
2
Yohann Roussel1b457412015-10-22 10:57:00 +02003Jack server
Yohann Roussele3f18c22016-02-24 16:16:42 +01004===========
Yohann Roussel1b457412015-10-22 10:57:00 +02005
Yohann Roussele3f18c22016-02-24 16:16:42 +01006The Jack server's goal is to handle a pool of Jack compiler instances in
7order to limit memory usage and benefit from already warm instances.
Yohann Roussel1b457412015-10-22 10:57:00 +02008
Yohann Roussel9710d332016-01-06 16:12:40 +01009Setup for Mac OS
10----------------
11
Yohann Roussele3f18c22016-02-24 16:16:42 +010012Jack server is automatically installed and started by android build but
13requires initial setup on Mac OS:
Yohann Roussel9710d332016-01-06 16:12:40 +010014
Yohann Roussele3f18c22016-02-24 16:16:42 +010015- Install MacPorts from macports.org
16 Make sure that /opt/local/bin appears in your path before /usr/bin.
17 If not, please add the following to your ~/.bash_profile file (If
18 you do not have a .bash_profile file in your home directory, create
19 one):
Yohann Roussel9710d332016-01-06 16:12:40 +010020
Yohann Roussele3f18c22016-02-24 16:16:42 +010021 export PATH=/opt/local/bin:$PATH`
Yohann Roussel9710d332016-01-06 16:12:40 +010022
Yohann Roussele3f18c22016-02-24 16:16:42 +010023- Get curl package from MacPorts:
Yohann Roussel9710d332016-01-06 16:12:40 +010024
Yohann Roussele3f18c22016-02-24 16:16:42 +010025 $ POSIXLY_CORRECT=1 sudo port install curl +ssl
Yohann Roussel9710d332016-01-06 16:12:40 +010026
Yohann Roussel1b457412015-10-22 10:57:00 +020027Starting the server
28-------------------
29
Yohann Roussele3f18c22016-02-24 16:16:42 +010030You may need to start the Jack server manually.
31Use jack-admin start-server.
Yohann Roussel1b457412015-10-22 10:57:00 +020032
33Client info
34-----------
35
Yohann Roussele3f18c22016-02-24 16:16:42 +010036The client is a bash script simply named jack.
37It can be configured in $HOME/.jack-settings
Yohann Roussel1b457412015-10-22 10:57:00 +020038
Yohann Roussele3f18c22016-02-24 16:16:42 +010039.jack-settings file
Yohann Roussel1b457412015-10-22 10:57:00 +020040
Yohann Roussele3f18c22016-02-24 16:16:42 +010041This file contains script shell variables:
42SERVER_HOST: IP address of the server
43by default: SERVER_HOST=127.0.0.1.
Yohann Roussel1b457412015-10-22 10:57:00 +020044
Yohann Roussele3f18c22016-02-24 16:16:42 +010045SERVER_PORT_SERVICE: Server service TCP port number. Needs to match the
46service port number defined in $HOME/.jack-server/config.properties on
47the server host (See Server info below)
48by default: SERVER_PORT_SERVICE=8076.
Yohann Roussel1b457412015-10-22 10:57:00 +020049
Yohann Roussele3f18c22016-02-24 16:16:42 +010050SERVER_PORT_ADMIN: Server admin TCP port number. Needs to match the
51admin port number defined in $HOME/.jack-server/config.properties on the
52server host (See Server info below)
53by default: SERVER_PORT_ADMIN=8077.
Yohann Roussel1b457412015-10-22 10:57:00 +020054
Yohann Roussele3f18c22016-02-24 16:16:42 +010055SETTING_VERSION: Internal, do not modify.
Yohann Roussel1b457412015-10-22 10:57:00 +020056
57Server info
58-----------
59
Yohann Roussele3f18c22016-02-24 16:16:42 +010060The server is composed of 2 jars named jack-server.jar and
61jack-launcher.jar.
Yohann Roussel1b457412015-10-22 10:57:00 +020062
Yohann Roussele3f18c22016-02-24 16:16:42 +010063Check Admin section to know how to install and administrate the Jack
64server.
Yohann Roussel1b457412015-10-22 10:57:00 +020065
Yohann Roussele3f18c22016-02-24 16:16:42 +010066The server can also be configured in
67$HOME/.jack-server/config.properties.
Yohann Roussel1b457412015-10-22 10:57:00 +020068
Yohann Roussele3f18c22016-02-24 16:16:42 +010069config.properties file
Yohann Roussel1b457412015-10-22 10:57:00 +020070
Yohann Roussele3f18c22016-02-24 16:16:42 +010071It contains Jack server configuration properties.
Yohann Rousselc9eb6ec2016-05-26 15:49:42 +020072Modifications to those settings are taken into account after restarting
73the server.
Yohann Roussel1b457412015-10-22 10:57:00 +020074Description with default values follows:
75
Yohann Roussele3f18c22016-02-24 16:16:42 +010076jack.server.max-service=<number>
77 Maximum number of simultaneous Jack tasks. Default is 4.
Yohann Roussel1b457412015-10-22 10:57:00 +020078
Yohann Roussele3f18c22016-02-24 16:16:42 +010079jack.server.max-jars-size=<size-in-bytes>
80 Maximum size for Jars, in bytes. -1 means no limit. Default is 100 MiB.
Yohann Roussel1b457412015-10-22 10:57:00 +020081
Yohann Roussele3f18c22016-02-24 16:16:42 +010082jack.server.time-out=<time-in-seconds>
83 Time out delay before Jack gets to sleep. When Jack sleeps, its memory
84usage is reduced, but it is slower to wake up. -1 means "do not sleep".
85Default is 2 weeks.
Yohann Roussel1b457412015-10-22 10:57:00 +020086
Yohann Roussele3f18c22016-02-24 16:16:42 +010087jack.server.service.port=<port-number>
88 Server service TCP port number. Default is 8076. Needs to match the
89service port defined in $HOME/.jack-settings on the client host (See
90Client section).
Yohann Roussel1b457412015-10-22 10:57:00 +020091
Yohann Roussele3f18c22016-02-24 16:16:42 +010092jack.server.admin.port=<port-number>
93 Server admin TCP port number. Default is 8077. Needs to match the
94service port defined in $HOME/.jack-settings on the client host (See
95Client section).
Yohann Roussel1b457412015-10-22 10:57:00 +020096
Yohann Roussele3f18c22016-02-24 16:16:42 +010097jack.server.config.version=<version>
98 Internal, do not modify.
Yohann Roussel1b457412015-10-22 10:57:00 +020099
100Server logs
Yohann Roussel1b457412015-10-22 10:57:00 +0200101
Yohann Roussele3f18c22016-02-24 16:16:42 +0100102Server logs can be found by running jack-admin server-log. Default
103location is $HOME/.jack-server/logs/.
Yohann Roussel1b457412015-10-22 10:57:00 +0200104
105Admin
106-----
107
Yohann Roussele3f18c22016-02-24 16:16:42 +0100108The jack-admin bash script allows to install and administrate the Jack
109server. Here are some commands:
Yohann Roussel1b457412015-10-22 10:57:00 +0200110
Yohann Roussele3f18c22016-02-24 16:16:42 +0100111$ jack-admin help
Yohann Roussel1b457412015-10-22 10:57:00 +0200112Print help.
113
Yohann Roussele3f18c22016-02-24 16:16:42 +0100114$ jack-admin install-server jack-launcher.jar jack-server.jar
Yohann Roussel1b457412015-10-22 10:57:00 +0200115Install the Jack server.
116
Yohann Roussele3f18c22016-02-24 16:16:42 +0100117$ jack-admin uninstall-server
Yohann Roussel1b457412015-10-22 10:57:00 +0200118Uninstall the Jack server and all components.
119
Yohann Roussele3f18c22016-02-24 16:16:42 +0100120$ jack-admin list jack
Yohann Roussel1b457412015-10-22 10:57:00 +0200121List installed versions for Jack.
122
Yohann Roussele3f18c22016-02-24 16:16:42 +0100123$ jack-admin update jack jack.jar
Yohann Roussel1b457412015-10-22 10:57:00 +0200124Install or update a Jack jar.
125
Yohann Roussele3f18c22016-02-24 16:16:42 +0100126$ jack-admin start-server
Yohann Roussel1b457412015-10-22 10:57:00 +0200127Start the server.
128
Yohann Roussele3f18c22016-02-24 16:16:42 +0100129$ jack-admin stop-server
Yohann Roussel1b457412015-10-22 10:57:00 +0200130Stop the server after the last compilation is complete.
131
Yohann Roussele3f18c22016-02-24 16:16:42 +0100132$ jack-admin kill-server
133Kill the server process immediately, interrupting abruptly ongoing
134compilations.
Yohann Roussel1b457412015-10-22 10:57:00 +0200135
Yohann Roussele3f18c22016-02-24 16:16:42 +0100136$ jack-admin list-server
Yohann Roussel1b457412015-10-22 10:57:00 +0200137List Jack server processes.
138
Yohann Roussele3f18c22016-02-24 16:16:42 +0100139$ jack-admin server-stat
Yohann Roussel1b457412015-10-22 10:57:00 +0200140Print various info about the server and the host.
141
Yohann Roussele3f18c22016-02-24 16:16:42 +0100142$ jack-admin server-log
Yohann Roussel1b457412015-10-22 10:57:00 +0200143Print log pattern.
144
Yohann Roussele3f18c22016-02-24 16:16:42 +0100145$ jack-admin dump-report
Jean-Philippe Lesot45657992016-01-20 03:19:22 +0100146Produce a report file that can be used to file a bug.
Yohann Roussel1b457412015-10-22 10:57:00 +0200147
Yohann Roussele3f18c22016-02-24 16:16:42 +0100148Transitioning from server 1.1 (e.g. Marshmallow) to server 1.3 (e.g. N)
149-----------------------------------------------------------------------
150
151The old Jack server used a $HOME/.jack configuration file. It has now
152replaced by a $HOME/.jack-settings and a
153$HOME/.jack-server/config.properties. If those new files do not exist,
154run jack-admin start-server and they will be created. If you had custom
155settings in your $HOME/.jack, here's how to adapt those.
156
157SERVER_PORT_SERVICE=XXXX
158Replace with SERVER_PORT_SERVICE=XXXX in $HOME/.jack-settings and
159jack.server.service.port=XXXX in $HOME/.jack-server/config.properties.
160
161SERVER_PORT_ADMIN=YYYY
162Replace with SERVER_PORT_ADMIN=YYYY in $HOME/.jack-settings and
163jack.server.admin.port=YYYY in $HOME/.jack-server/config.properties.
164
165SERVER_NB_COMPILE=N
166Replace with jack.server.max-service=N in
167$HOME/.jack-server/config.properties.
168
169SERVER_TIMEOUT=ZZ
170You can replace with jack.server.time-out=ZZ, but it is recommended to
171keep the default setting of "7200" (2 hours).
172
173Other settings in the $HOME/.jack configuration file do not need to be
174copied. You should still keep your $HOME/.jack configuration file for
175the old Jack server because both server versions can run simultaneously.
Yohann Roussel1b457412015-10-22 10:57:00 +0200176
177Troubleshooting
178---------------
179
Yohann Roussele3f18c22016-02-24 16:16:42 +0100180Below you'll find some ways to solve some troubleshooting. If you don't
181find a solution, file a bug and attach the file produced by
182jack-admin dump-report.
Jean-Philippe Lesot45657992016-01-20 03:19:22 +0100183
Yohann Roussele3f18c22016-02-24 16:16:42 +0100184If compilation fails on No Jack server running
Jean-Philippe Lesot45657992016-01-20 03:19:22 +0100185
Yohann Roussele3f18c22016-02-24 16:16:42 +0100186See Starting the server above.
Yohann Roussel1b457412015-10-22 10:57:00 +0200187
Yohann Rousselc9eb6ec2016-05-26 15:49:42 +0200188If your computer becomes unresponsive during compilation:
Yohann Roussel1b457412015-10-22 10:57:00 +0200189
Yohann Roussele3f18c22016-02-24 16:16:42 +0100190You can improve the situation by reducing the number of jack
191simultaneous compilations by editing your
192$HOME/.jack-server/config.properties and changing
Yohann Rousselc9eb6ec2016-05-26 15:49:42 +0200193jack.server.max-service to a lower value and then restarting the server.
194
195If you experience Jack compilations failing on Out of memory error.:
196
197You can improve the situation by reducing the number of jack
198simultaneous compilations by editing your
199$HOME/.jack-server/config.properties and changing
200jack.server.max-service to a lower value and then restarting the
201server.
202If this is not enough, you may change the arguments used to start the
203server jvm and force a greater maximum Java heap size ("-Xmx"):
204- Stop the server using jack-admin stop-server, then:
205- If you start the server manually:
206JACK_SERVER_VM_ARGUMENTS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" jack-admin start-server
207- If you use the jack server in the android tree then
208export ANDROID_JACK_VM_ARGS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
209and restart your build command.
Yohann Roussel1b457412015-10-22 10:57:00 +0200210
Yohann Roussele3f18c22016-02-24 16:16:42 +0100211If you have trouble starting the server
Yohann Roussel1b457412015-10-22 10:57:00 +0200212
Yohann Roussele3f18c22016-02-24 16:16:42 +0100213This may mean that TCP ports are already in use on your computer. You
214can try modifying the ports both in your client and server
215configurations. See the Server info and Client info sections. If it
216doesn't solve the problem, please report and give us additional
217information by:
218 - Attaching your compilation log.
219 - Attaching the file produced by jack-admin dump-report
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +0100220
221If your commands fails on
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +0100222
Yohann Roussele3f18c22016-02-24 16:16:42 +0100223Failed to contact Jack server: Problem reading<your home>/.jack-server/client.pem
Yohann Roussel1b457412015-10-22 10:57:00 +0200224
Yohann Roussele3f18c22016-02-24 16:16:42 +0100225This may mean that your server never managed to start, see If you have
226trouble starting the server above.
Yohann Roussel1b457412015-10-22 10:57:00 +0200227
Yohann Roussele3f18c22016-02-24 16:16:42 +0100228If your compilation gets stuck without any progress
Yohann Roussel1b457412015-10-22 10:57:00 +0200229
Yohann Roussele3f18c22016-02-24 16:16:42 +0100230Please report and give us additional information by attaching the file
231produced by jack-admin dump-report.
232Then restart the server by issuing commands
233jack-admin kill-server; jack-admin start-server