- Java 1.8
- Maven 3.0 or later
- Tomcat 89
Sakai 1220.0 was QA tested with Java 1.8.0_111252, maven - 3-2.5. (though maven-3.3.9 should also work), Apache Tomcat 89.50.2819
1.1 Verify/Install Java 1.8
If Java is installed, basic version and build information will be displayed. Example output:
javaopenjdk version "1.8.0_111252" Java(TM) SE
OpenJDK Runtime Environment (build 1.8.0_31-b13) Java HotSpot(TM) 252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.31252-b07b09, mixed mode)
1.1.1 Set Java environment variables
If the variable JRE_HOME is already set or if you want to use a particular JRE if you have more than one JRE installed on your machine then you'll want to set the JRE_HOME variable as well. JRE_HOME is what Apache Tomcat uses when it starts up, but it defaults to use JAVA_HOME if JRE_HOME is not set. In most cases, setting JAVA_HOME should cover both cases sufficiently.
Windows: append the string to the end of the
Path system variable
It is recommended to use Maven 3.2.5 through 3.3.9.+.
You can download Maven at
Extract the distribution archive into your installation directory of choice, e.g.
/usr/local/apache-maven-3.2.2. Confirm that you have installed the correct version of Maven and can start it by issuing
mvn --version from the terminal. At this point your environment is prepared to build and deploy the Sakai source code.
Apache Maven 3.25.54 (45f7c06d68e745d05611f7fd14efb6594181933e1edded0938998edf8bf061f1ceb3cfdeccf443fe; 20142018-06-17T0917T14:5133:4214-04:00)
Maven home: /usr/local/apache-maven-3.2.5 share/maven3
Java version: 1.8.0_111252, vendor: OraclePrivate Corporation Java homeBuild, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "34.1315.0-3065-generic", arch: "amd64", family: "unix"
MAVEN_HOME environment variable to point to the base directory of your Maven installation and add the Maven
/bin directory to your
Windows: append string to the end of the
Path system variable
- Apache Tomcat - http://tomcat.apache.org/
- Note: Always do a fresh install of Tomcat 89
- Note: For Sakai versions prior to 11.4 please use Tomcat 8.0.34 or earlier. Later versions of Tomcat may cause problems. example: SAK-31608 - Sakai has startup warnings on Tomcat 8.0.39+ CLOSEDNote: Windows users should ensure that there are no spaces in the complete tomcat path as this causes errors with JSF tools in Sakai
GOOD: C:\opt\tomcat\, C:\sakaistuff\installs\tomcat\
BAD: C:\program files\tomcat\, C:\opt\apache tomcat 89.0.4319\
- Download Tomcat 8 9 - https://tomcat.apache.org/download-8090.cgi
Windows users should get the zip file instead of installing a service
It makes viewing the tomcat logs easier and it is easier to configure
- Extract to /opt (symlink the apache-tomcat-8.0.x directory to tomcat after extracting)
Example (assuming you have saved the file as /opt/apache-tomcat-89.0.x.tar.gz)
tar xzvf apache-tomcat-
ln -nsf apache-tomcat-
Windows users should either rename the directory or, if comfortable, create a directory junction using an elevated cmd prompt:
mklink /J C:\apache-tomcat-
- Modify conf/server.xml for international character support
- Add URIEncoding="UTF-8" to the Connector element
- <Connector port="8080" URIEncoding="UTF-8" ...
- Add URIEncoding="UTF-8" to the Connector element
- Set environment variable: CATALINA_HOME=/opt/tomcat
- Add $CATALINA_HOME/bin to PATH
Setup the SETENV file in the tomcat/bin directory with JAVA_OPTS (from Install Java 1.8).
Populate Database With Demo Data
You can populate the database with Demo data or use the quartz job Create Test Sites (Not recommended for production environments)
- Using the quartz job will create some sample sites with some sample data in tools ideal for testing
Another alternative instead of starting with an empty database you can add the flag -Dsakai.demo=true in addition to the others shown here. During your first Tomcat launch it will populate your database with test data (students, courses, etc). Once the data has been created remove this flag for subsequent Tomcat launches. Be advised that this flag will not trigger on a database with data already in it so you must make this choice during the initial setup. It should also be noted that without this flag one will not be able to create any course sites in Sakai unless Academic Term, Subject, Course, and Section data is manually added to the "cm_" tables in the database.
We recommend using -Djava.util.Arrays.useLegacyMergeSort=true until this issue can be resolved - SAK-31707 - Broken Equality Comparators in Gradebook RESOLVED
Mac/Linux: Create a file called setenv.sh with the following (alternately, you can put this into your .bashrc file so they're automatically executed):
Tomcat 8 Mac/Linux
"-server -d64 -Xms1g -Xmx2g -Djava.awt.headless=true -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC"
"$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
Windows(PC): Create a file called setenv.bat with the following:
Tomcat 8 Windows
set JAVA_OPTS=-server -Xmx1028m -XX:MaxMetaspaceSize=512m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=
-Dcom.sun.management.jmxremote -Dhttp.agent=Sakai -Djava.util.Arrays.useLegacyMergeSort=
[OPTIONAL] Delete the default webapps from the webapps dir
rm -rf webapps/*
For Sakai 12 and earlier: Edit the file conf/context.xml and add this JarScanFilter block to the <Context>
For Sakai 19 and later: After the JSF 2.3 migration, users may update the tomcat configuration to this one:
2.0 Get the Sakai source code
Sakai source code can be checked forked from our Github repository. The latest development work is located in
the master branch; stable releases can be found in
tags while maintenance and other work is performed in a 1920.x branch.
20 release tag
To checkout a stable release tag, clone the git repo and then checkout the tag (in this case 1920.0):
git clone https://github.com/sakaiproject/sakai.git cd sakai && git checkout 1920.0
The latest stable release may be newer than the version listed above. Please see https://github.com/sakaiproject/sakai/releases.
20.x maintenance branch
The latest bug fixes for a particular release can be found in our maintenance branches. Please note that certain maintenance branch fixes require database schema changes. You can check out the maintenance branch by issuing the following command from the terminal:
git clone https://github.com/sakaiproject/sakai.git cd sakai && git checkout 1920.x
If you all ready have cloned the repository, skip step the clone step above.
If you need to override the default settings you must create your own
sakai.properties file either from scratch or from a known working copy adding new key/value settings in order to customize your installation. We recommend that you review the
default.sakai.properties file included in the source installation or in the appropriate maintenance branch.
The default location for your local
sakai.properties file is
$CATALINA_HOME/sakai. This folder is not created by Maven during the build and deployment process, so you will have to create it manually or via a script. You can also store Sakai's configuration files outside of your web application server's file hierarchy. For example, in a development environment you may find yourself frequently reinstalling Tomcat and unless you create a build script to automate the Tomcat installation and configuration process avoiding having to recreate
sakai.properties each time has its advantages.
Depending on usage, Sakai may create many large temporary files in the system temporary file storage location (e.g. /tmp). It is a good practice to routinely remove temporary files older than a day, especially if you have a lot of users or have heavy usage of mail sending with attachments. Note that you should not simply remove all temp files on a schedule as some of them may be in active use (also be careful about removing temp files which are used by other processes).
3.1 Configure database
Make sure to include a MySql connector jar in your CATALINA_HOME/lib.
-Dmaven.tomcat.home specifies Tomcat's location. -Dsakai.home specifies the location of the sakai properties file(s) within Tomcat. -Djava.net.preferIPv4Stack can help resolve issues with Maven hanging while attempting to pull from certain repositories. These can be omitted if specified in Maven's
settings.xml file (version 2.x) or in MAVEN_OPTS (version 3.x).
mvn clean install sakai:deploy -Dmaven.tomcat.home=/pathto/tomcathome -Dsakai.home=/pathto/tomcathome/sakai -Djava.net.preferIPv4Stack=true
mvn clean install -Dmaven.test.skip=true sakai:deploy
Build and Deploy with exploded wars
The framework build profile triggers a Sakai build minus it's tool set.
The -Pframework build profile is no longer supported in Sakai 10.x versions.
normal build will deploy the war files which when tomcat starts will expand them, you can forgo this intermediate step and deploy expanded war files which occupy much less space:
mvn clean install sakai:deploy
Perform a "cafe" build
The programmers' cafe build profile is favored by many developers new to Sakai as well as those developing or testing new capabilities.
The -Pcafe build profile is no longer supported in Sakai 10.x versions.
mvn -Pcafe clean install sakai:deploy -exploded
4.1 Start/Stop Tomcat
Start/stop Tomcat from the terminal by running the appropriate startup/shutdown script located in