Java Environment Variables (2.6)
Several environment variables and related properties must be set for Java. For UNIX operating systems one typically modifies a startup file like ~/.bash_login
to set and export shell variables while Mac users typically set and export environment variables in .bash_profile
. For Windows, go to Start -> Control Panel -> System -> Advanced -> Environment Variables
and set JAVA_HOME
via the GUI.
Set the JAVA_HOME environment variable to point to the base directory of your Java installation and add Java's /bin
directory to the PATH environment variable.
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.
Variable |
Unix |
Mac |
Windows |
---|---|---|---|
JAVA_HOME |
|
|
|
PATH |
|
|
|
Windows: append the string to the end of the Path
system variable
Set JAVA_OPTS
The default Java virtual machine (JVM) settings are insufficient for an application of Sakai's size. As a result several JVM parameters must be increased for Sakai to run, while others may need to be adjusted for optimal performance. At a minimum add the following property settings to your JAVA_OPTS
environment variable. We recommend that you define these settings in Tomcat's /bin
directory in a file named setenv.sh (Unix/Mac) or setenv.bat
(Windows). See the Tomcat section below for more details.
Unix/Mac:
export JAVA_OPTS='-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=128m -Djava.awt.headless=true -Dhttp.agent=Sakai -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false'
Windows:
set JAVA_OPTS=-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=160m -Djava.awt.headless=true -Dhttp.agent=Sakai -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false}}
Java 6 users must also add the following setting to their JAVA_OPTS:
-Dsun.lang.ClassLoader.allowArraySyntax=true
Specify a Language and Locale (optional)
You can define the default language/locale when starting Sakai by setting the system properties -Duser.language
and -Duser.region
. For information on supported languages see the release notes or visit the i18N Work Group space.
-Duser.language=pt -Duser.region=PT
Specify an HTTP Proxy (optional)
In environments where local network policy or firewalls require use of an upstream HTTP proxy/cache, Sakai needs to be configured accordingly. Otherwise components or services which use HTTP requests, such as the BasicNewsService
for RSS feeds in the News tool, cannot retrieve data from the target URLs. This can be fixed with the following JAVA_OPTS
arguments:
-Dhttp.proxyHost=cache.some.domain -Dhttp.proxyPort=8080
Tomcat 5.5.27+
Tomcat 5.5.27+ enforces strict quote escaping a change in *.jsp handling that have yet to be addressed in certain tools such as portfolios. The workaround requires adding this system property. See - SAK-15736Getting issue details... STATUS .
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false