« Back to Quick...

Custom Java Install

Introduction #

Liferay Portal comes bundled with a JRE for Windows users. If you are a user who wants to use a custom version of Java, please follow these instructions to configure it.

Installing Custom Java (Windows Users) #

If you do want to use your own Java instead of Liferay's bundled JRE, don't install java in the default location. Instead, install it to a folder near the root folder on your machine, such as C:\Java. Use the subfolder name that it gives you (i.e., jdk1.6.xx_x) so that the full path looks something like C:\Java\jdk1.6.xx_x. When the installer for Java comes up, change the path for that too so that it is inside C:\Java.

Setting System Variables #

When you are finished, go to the Windows Control Panel and click the "System" icon. Go to "Advanced," and click the "Environment Variables" button. Add a new system variable (not a user variable) called JAVA_HOME, and point it to the directory to which you installed the JDK (i.e., C:\Java\jdk1.6.xx_x). Click OK, and then edit the Path variable (you don't need to add it, it is already among your variables), which you'll find in the list of system variables. At the beginning of the variable, add a section which reads %JAVA_HOME%\bin and put a semicolon (;) after it. Click OK until you come out of all the dialog boxes, and then open a Command Prompt window. Type java –version and press Enter. If you get a message telling you the version of Java, you’ve correctly configured the JDK. If not, check your JAVA_HOME variable to see if you have it pointing to the location of your JDK install correctly, and make sure your syntax is correct in your Path variable.

  • Note: This article frequently talks about the JDK, but a JRE will usually be enough - at least when you're running the tomcat bundle. You might need to set JRE_HOME instead of JAVA_HOME though.
0 Attachments
15410 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
Threaded Replies Author Date
good Basem Mourad June 13, 2012 2:15 PM

Posted on 6/13/12 2:15 PM.