Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Allen Ross
niether JAVA_HOME nor JRE_HOME variable defined
27. Juni 2012 21:32
Antwort

Allen Ross

Rang: New Member

Nachrichten: 4

Eintrittsdatum: 27. Juni 2012

Neue Beiträge

On CentOS 6, installed Liferay 6.1 ce bundled with tomcat 7.0.23.

In opt/liferay/tomcat/bin run ./startup.sh and get:

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

The default setenv.bat is:

if exist "%CATALINA_HOME%/jre1.6.0_20/win" (
if not "%JAVA_HOME%" == "" (
set JAVA_HOME=/jre1.6.0_20/win
)

set "JRE_HOME=%CATALINA_HOME%/jre1.6.0_20/win"
)

set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"

I have tried several different paths for each value in .bat with no success.

Any ideas? What am I missing?
Hitoshi Ozawa
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 05:06
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7952

Eintrittsdatum: 23. März 2010

Neue Beiträge

Do you have JDK installed on your CentOS? Be sure to replace pre-installed OpenJDK with Oracle JDK because OpenJDK may not work properly.
Allen Ross
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 12:03
Antwort

Allen Ross

Rang: New Member

Nachrichten: 4

Eintrittsdatum: 27. Juni 2012

Neue Beiträge

Yes, I have it installed at /usr/java/jdk1.7.0 and set the path in /opt/liferay/tomcat/setenv.bat to

if exist "%CATALINA_HOME%/jre1.6.0_20/win" (
if not "%JAVA_HOME%" == "" (
set JAVA_HOME=/usr/java/jdk1.7.0/

set "JRE_HOME=%CATALINA_HOME%/jre1.6.0_20/win"
)

set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"
David H Nebinger
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 12:14
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 8393

Eintrittsdatum: 1. September 2006

Neue Beiträge

Do not use JDK 1.7.

Besides, you're running a Unix variant, you shouldn't be using the .bat guys to begin with. Use the .sh bash scripts...
Allen Ross
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 12:15
Antwort

Allen Ross

Rang: New Member

Nachrichten: 4

Eintrittsdatum: 27. Juni 2012

Neue Beiträge

Got it ... so use 1.6?
David H Nebinger
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 12:17
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 8393

Eintrittsdatum: 1. September 2006

Neue Beiträge

1.6 with the unix scripts, yes.
Hitoshi Ozawa
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 14:31
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7952

Eintrittsdatum: 23. März 2010

Neue Beiträge

Yes, configure your environment in setup.sh instead of setup.bat. Use ./startup.sh to execute.
How were you executing startup.bat on CentOS anyways? I hope that you're not going to tell us that you have Windows installed as a vm and trying to run liferay in that. :-)
Allen Ross
RE: niether JAVA_HOME nor JRE_HOME variable defined
28. Juni 2012 15:21
Antwort

Allen Ross

Rang: New Member

Nachrichten: 4

Eintrittsdatum: 27. Juni 2012

Neue Beiträge

Looks like that was the issue ... once I installed 1.6 it fired right up. Interesting that I read many places that people were using 1.7, but it must have been with another bundle or EE. Anyhow ... thanks.
Hitoshi Ozawa
RE: niether JAVA_HOME nor JRE_HOME variable defined
29. Juni 2012 07:13
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7952

Eintrittsdatum: 23. März 2010

Neue Beiträge

Interesting that I read many places that people were using 1.7, but it must have been with another bundle or EE. Anyhow ... thanks.


Same with the EE version. Liferay.com has stated they still do not support 1.7 because of known problems which they have not fixed.