Java: Difference between revisions

From Halfface
Jump to navigation Jump to search
Line 38: Line 38:
Error output in logfile.
Error output in logfile.
=multicast test=
=multicast test=
  [ipcenter@produtil02.ipsoft.ny1 tmp]$ java MulticastReceiver
  host1: java MulticastReceiver
  Starting multicast receiver in group 224.1.0.1 on port 14454
  Starting multicast receiver in group 224.1.0.1 on port 14454
  hello
  hello
Line 45: Line 45:
  On host2:
  On host2:
   
   
  [ipcenter@produtil01.ipsoft.ny1 tmp]$ java MulticastSender
  host2: java MulticastSender
  hello
  hello
  how are you
  how are you

Revision as of 18:47, 10 February 2017

Java information

To list keys in java keystore.

/usr/java/jre1.6.0_03/bin/keytool --list --keystore /usr/java/jre1.6.0_03/lib/security/cacerts

Import key in java keystore.

openssl x509 -outform der -in certificate.pem -out certificate.der
keytool -import -alias your-alias -keystore cacerts -file certificate.der

List content of der.

openssl x509 -in BPClass3RootCA.cer -inform der -noout -text

show jar file signing

jarsigner -verify -verbose -certs file.jar

modify settiings

jcontrol

connect via jmx

jcontrol

connect to jvm

jvisualvm

java options

Sets the initial memory size

-Xms256m / -ms256m

Specifies the maximum memory size

-Xmx2048m / -mx20148m

install java

#!/bin/bash
JDK_VERSION=8u71
JDK_BUILD_VERSION=b15
cd /tmp
curl -LO "http://download.oracle.com/otn-pub/java/jdk/$JDK_VERSION-$JDK_BUILD_VERSION/jdk-$JDK_VERSION-linux-x64.rpm" -H 'Cookie: oraclelicense=accept-securebackup-cookie'
rpm -i jdk-$JDK_VERSION-linux-x64.rpm
rm -f jdk-$JDK_VERSION-linux-x64.rpm

heap utilization

jstat -gc ${PID}

stack trace

Error output in logfile.

multicast test

host1: java MulticastReceiver
Starting multicast receiver in group 224.1.0.1 on port 14454
hello
how are you
 
On host2:

host2: java MulticastSender
hello
how are you