Skip to content

Commit

Permalink
Updated scripts for jdk11
Browse files Browse the repository at this point in the history
  • Loading branch information
mondain committed Jan 7, 2021
1 parent 9ad2614 commit fc1927c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
8 changes: 3 additions & 5 deletions src/main/server/red5.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if NOT DEFINED JAVA_HOME goto err

REM JAVA options
REM You can set JVM additional options here if you want
if NOT DEFINED JVM_OPTS set JVM_OPTS=-Xms256m -Xmx1g -Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true
if NOT DEFINED JVM_OPTS set JVM_OPTS=-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms256m -Xmx1g -Xverify:none -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:MaxGCPauseMillis=500 -XX:ReservedCodeCacheSize=32m
REM Set up logging options
set LOGGING_OPTS=-Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true
REM Set up security options
Expand All @@ -17,11 +17,9 @@ set SECURITY_OPTS=-Djava.security.debug=failure
REM Set up tomcat options
set TOMCAT_OPTS=-Dcatalina.home=%RED5_HOME%
REM Native path
set NATIVE=-Djava.library.path="%RED5_HOME%\lib\native"
REM Setup python/jython path
set JYTHON_OPTS=-Dpython.home=lib
set NATIVE=-Djava.library.path="%RED5_HOME%\lib\amd64-Windows-msvc"
REM Combined java options
set JAVA_OPTS=%LOGGING_OPTS% %SECURITY_OPTS% %JAVA_OPTS% %JVM_OPTS% %TOMCAT_OPTS% %NATIVE% %JYTHON_OPTS%
set JAVA_OPTS=%LOGGING_OPTS% %SECURITY_OPTS% %JAVA_OPTS% %JVM_OPTS% %TOMCAT_OPTS% %NATIVE%

set RED5_CLASSPATH=%RED5_HOME%\red5-service.jar;%RED5_HOME%\conf;%CLASSPATH%

Expand Down
32 changes: 12 additions & 20 deletions src/main/server/red5.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ if [ -z "$RED5_HOME" ]; then
export RED5_HOME=`pwd`;
fi

# Java 11
export JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto

P=":" # The default classpath separator
OS=`uname`
case "$OS" in
CYGWIN*|MINGW*) # Windows Cygwin or Windows MinGW
P=";" # Since these are actually Windows, let Java know
P=";" # Since these are actually Windows, let Java know
# Native path
NATIVE="-Djava.library.path=$RED5_HOME/lib/amd64-Windows-msvc"
;;
Linux*)
LD_LIBRARY_PATH=$RED5_HOME/lib/native
LD_LIBRARY_PATH=$RED5_HOME/lib/amd64-Linux-gpp
export LD_LIBRARY_PATH
# Native path
NATIVE="-Djava.library.path=$LD_LIBRARY_PATH"
;;
Darwin*)
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$RED5_HOME/lib/native
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$RED5_HOME/lib/x86_64-MacOSX-gpp
export DYLD_LIBRARY_PATH
# Native path
NATIVE="-Djava.library.path=$DYLD_LIBRARY_PATH"
Expand All @@ -35,18 +40,17 @@ esac
echo "Running on " $OS

# JAVA options
# ZGC collector https://wiki.openjdk.java.net/display/zgc
# You can set JVM additional options here if you want
if [ -z "$JVM_OPTS" ]; then
JVM_OPTS="-Xms256m -Xmx1g -Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:MaxGCPauseMillis=500 -XX:ReservedCodeCacheSize=32m"
JVM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms256m -Xmx1g -Xverify:none -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:MaxGCPauseMillis=500 -XX:ReservedCodeCacheSize=32m"
fi
# Set up security options
SECURITY_OPTS="-Djava.security.debug=failure"
# Set up tomcat options
TOMCAT_OPTS="-Dcatalina.home=$RED5_HOME -Dcatalina.useNaming=true"
# Jython options
JYTHON="-Dpython.home=lib"

export JAVA_OPTS="$SECURITY_OPTS $JAVA_OPTS $JVM_OPTS $TOMCAT_OPTS $NATIVE $JYTHON"
export JAVA_OPTS="$SECURITY_OPTS $JAVA_OPTS $JVM_OPTS $TOMCAT_OPTS $NATIVE"

if [ -z "$RED5_MAINCLASS" ]; then
export RED5_MAINCLASS=org.red5.server.Bootstrap
Expand All @@ -56,19 +60,7 @@ if [ -z "$RED5_OPTS" ]; then
export RED5_OPTS=9999
fi

for JAVA in "${JAVA_HOME}/bin/java" "${JAVA_HOME}/Home/bin/java" "/usr/bin/java" "/usr/local/bin/java"
do
if [ -x "$JAVA" ]
then
break
fi
done

if [ ! -x "$JAVA" ]
then
echo "Unable to locate Java. Please set JAVA_HOME environment variable."
exit
fi
JAVA="${JAVA_HOME}/bin/java"

export RED5_CLASSPATH="${RED5_HOME}/red5-service.jar${P}${RED5_HOME}/conf${P}${CLASSPATH}"

Expand Down

0 comments on commit fc1927c

Please sign in to comment.