Skip to content

Instantly share code, notes, and snippets.

@patmandenver
Created August 16, 2015 15:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmandenver/43f2f8690302bf85fc34 to your computer and use it in GitHub Desktop.
Save patmandenver/43f2f8690302bf85fc34 to your computer and use it in GitHub Desktop.
Tomcat 8 APR fix for Ubuntu 14.40 and Oracle Java 7 installed
#!/bin/bash
#
# Simple script to install Oracle Java 7 with auto accepting the license
# No need to interact with it
#
######################################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
echo ""
echo "Installing APR Tomcat tool"
apt-get install libapr1 libaprutil1 libapr1-dev libssl-dev make
wget http://apache.mirrors.tds.net/tomcat/tomcat-connectors/native/1.1.33/source/tomcat-native-1.1.33-src.tar.gz
tar -xvzf tomcat-native-1.1.33-src.tar.gz
cd tomcat-native*/jni/native
ln -s /usr/lib/jvm/java-7-oracle/include/linux /usr/lib/jvm/java-7-oracle/jre/linux
ln -s /usr/lib/jvm/java-7-oracle/include/linux/jni_md.h /usr/lib/jvm/java-7-oracle/include/jni_md.h
ln -s /usr/lib/jvm/java-7-oracle/include/linux/jawt_md.h /usr/lib/jvm/java-7-oracle/include/jawt_md.h
./configure --with-java-home=/usr/lib/jvm/java-7-oracle/ --with-apr=/usr/bin/apr-1-config --with-os-type=include/linux
make
make install
ln -s /usr/local/apr/lib/libtcnative-1.so /usr/lib/libtcnative-1.so
@russellhoff
Copy link

Thanks, I followed this script and executed manually, and it permitted me to compile apache native library in my tomcat 8 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment