Wednesday, September 12, 2012

Three quick JDeveloper tricks: memory tweaks, 64-bit and SSL

You are a SOA Suite developer and you are looking for a way to enhance your experience with JDeveloper. Below are three tips that any developer can use to: provide additional memory to JDeveloper, connect it to servers via SSL, and run it in 64-bit.

Memory Tweaks:
So you have added more memory your machine, but you are not seeing an increase in your JDeveloper performance. If you are new to the Java world it is possible that you don't know about the JVM parameters that that are used for available. The parameters are spread across two different files <MIDDLEWARE_HOME>\jdeveloper\ide\bin\ide.conf and <MIDDLEWARE_HOME>\jdeveloper\jdev\bin\jdev.conf.

The first two parameters are -Xmx and -Xms these are the max and min for heap memory for the JVM and are located in the ide.conf.  There's not really much of an advantage with changing the -Xms in this case. However if you notice that your JDeveloper has been getting slow and possibly may need more RAM increasing this can have great results.

The third parameter is MaxPermSize and is located in the jdev.conf file. This parameter deals with the PermGen space, which holds information on all classes as they are loaded along with related metadata. This can be increased, but only really needs to if you are getting PermGen errors.

SSL:
If you are looking for JDeveloper to have the ability to connect to SSL enabled Application servers and Databases it is possible that they are internal servers which own certificates signed by a company Root Cerificate Authority(CA) or by another non-typical CA such as Verisign or Thawte. In this case JDeveloper by default will not trust the certificate. To remedy this you need to add the CAs to be trusted.


1. Acquire the certificates in PEM or another format. So that they may be imported later.

2. Open a command prompt and navigate to your JDK bin directory (This is not necessary if your JDK bin is located in your path).

3. Run the keytool to import the certificates.
The certificates should be imported into the cacerts file located in <MIDDLEWARE_HOME>\jdk160_24\jre\lib\security by default, but if you are not using the built in JDK will be located in <JDK>\jre\lib\security. If the certificates are chained it is good practice to import the the Root certificate first then follow down the hierarchy to ensure that all necessary CA certificatess have been imported.

To import the certificates use the following command:
keytool -importcerts -alias <alias> -trustcacerts -file <path/to/file> -keystore cacerts
Note: There is no password on cacerts so when prompted just press enter.

Once all the certificates are imported JDeveloper should easily connect to the servers.
Update: This can also performed using the steps from a preview post by Ahmed here.

64-bit JVM:
Before proceeding it is good to note that after doing performing this step any customizations that have been you made to the 32-bit JVM will need to be redone. Changes include those mentioned in the SSL section.
1. Find the maximum compatible JDK
To do this you must go into Help->About and find ide.java.maxversion. This number should be the limit, for example if it says 1.8 then you can use everything up to the latest update to 1.7.XXX

2. Download and Install 64-bit JDK
This is an easy process, so I won't waste your time. Just make sure that the SDK version is correct for your version of JDeveloper. Also, note the location of your JDK because that will be needed.

3. Update the configuration file
In the <MIDDLEWARE_HOME>\jdeveloper\jdev\bin\jdev.conf file you simply need to change the line with SetJavaHome from the default of <MIDDLEWARE_HOME>\jdk to your new JDK location.

4. Make any and all modifications necessary to the JDK files
At this point in time it is necessary to make any modifications that had been made to the original JDK to the 64-bit one. This will ensure that the same functionality is offered by the new JDK.


References:
Presenting the Permanent Generation

No comments: