Archive for category Java
Java Keytool commands
Dec 10
Java Keytool Commands for Creating and Importing
These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. Any root or intermediate certificates will need to be imported before importing the primary certificate for your domain.
Generate a Java keystore and key pair
keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048
Generate a certific Read More
Default JRE for browsers
Dec 9
To change the default JRE for browsers:
To switch to jre 1.5.x
1. Go to the C:\Program Files\Java\j2re1.5.x_xx\bin directory where JRE 1.5.x was installed.
2. Double-click the jpicpl32.exe file. It will launch the control panel for 1.5.x
3. Select the Browser tab. Microsoft Internet Explorer might still appear to be set (checked).
4. Uncheck that and click Apply.
5. Again select that chekbox and click Apply.
6. Res Read More
The following code retrieves Free Memory, Total Memory, Max Memory allocated to JVM
Runtime runtime = Runtime.getRuntime();
System.out.println(“max memory: ” + runtime.maxMemory() / (1024.0*1024.0));
System.out.println(“allocated memory: ” + runtime.totalMemory() / 1024);
System.out.println(“free memory: ” + runtime.freeMemory() / 1024);
Bookmark on DeliciousDigg this post Reco Read More
Java Code Conventions
Apr 29
CodeConventions
Bookmark on DeliciousDigg this post Recommend on FacebookShare with StumblersTweet about itSubscribe to the comments on this post Read More
Setting java heap size
Apr 6
Tomcat
Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. For example,
set CATALINA_OPTS=-Xms512m -Xmx512m (Windows, no "" around the value)
JBoss
Stop JBoss server, edit $JBOSS_HOME/bin/run.conf, and then restart JBoss server.
JAVA_OPTS="-server -Xms128m -Xmx128m"
Eclipse
You have 2 options:
1. Edit eclipse-home/eclipse.ini to be something like the following and restart Ecl Read More
