java

Launching Java Apps

Windows

cd C:\Program Files (x86)\Java\jre1.8.xx\bin

keytool -keystore ..\lib\security\cacerts -import -alias site.fqdn.com -file server.txt

edit C:\Program Files (x86)\Java\jre1.8.0_xx\lib\security\java.policy

permission java.net.SocketPermission "*.site.fqdn.com:443", "connect,resolve";

open java or configure java in the start menu

Click on Security Tab

Select Security Level: High

Add https://site.fqdn.com to exceptions list at the bottom

Configure Linux as root

cd /usr/java/jdk1.7.?_??/jre/lib/security (for Ubuntu this may be in /opt/java/64/jre1.7.0_07/lib/security/ )

sudo curl -O https://site.fqdn.com/server.txt

keytool -keystore ./cacerts -import -alias site.fqdn.com -file server.txt

Configure OS X

cd /Library/Java/Home/lib/security (alternatively /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/)

sudo curl -O https://site.fqdn.com/server.txt

keytool -keystore ./cacerts -import -alias site.fqdn.com -file server.txt

thread dump / heap dump

set -x

HOST=`hostname | sed 's/\..*//'`

export JAVA_HOME=/usr/java/default

export PATH=$JAVA_HOME/bin:$PATH

APP_LOGS=/logs/tomcat/

TIMESTAMP=`date +%s`

APP_LOG_DIR=$APP_LOGS/$TIMESTAMP

mkdir $APP_LOG_DIR

echo $APP_LOG_DIR

cd /usr/java/default/

PID=`ps -ef | grep java | grep -i -- 'org.apache.catalina.startup.Bootstrap' | grep -v grep | awk '{print $2}'`

jstack -l $PID > $APP_LOG_DIR/threaddump.txt

jmap -heap $PID > $APP_LOG_DIR/heapsummary.txt

jmap -histo $PID > $APP_LOG_DIR/histogram.txt

cd $APP_LOG_DIR

jmap -dump:live,format=b,file=heap.bin $PID

netstat -an > $APP_LOG_DIR/netstat.txt

/usr/sbin/lsof -p $PID > $APP_LOG_DIR/lsof.txt