cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot start Alfresco after install

mjohngren
Champ in-the-making
Champ in-the-making
Hi, I have seen similar questions to mine on the forum but do not see a clear answer.

I have installed alfresco on linux and am running alfresco.sh and get the following response:

[root@sparkpress alfresco]# ./alfresco.sh start
Using CATALINA_BASE:   /opt/alfresco/tomcat
Using CATALINA_HOME:   /opt/alfresco/tomcat
Using CATALINA_TMPDIR: /opt/alfresco/tomcat/temp
Using JRE_HOME:       /usr/bin/java
[root@sparkpress alfresco]#
Alfresco does not start.

When I check catalina.out, I see only the following:

[root@sparkpress logs]# more catalina.out
/opt/alfresco/tomcat/bin/catalina.sh: line 273: /usr/bin/java/bin/java: Not a directory
Obviously this should just say /usr/bin/java, and I have set the JAVA_HOME variable properly:

[root@sparkpress alfresco]# echo $JAVA_HOME
/usr/bin/java

So I am not sure where the incorrect /usr/bin/java/bin/java is coming from.

Can anyone please help with this?  Thank you!
15 REPLIES 15

makoildha
Champ in-the-making
Champ in-the-making
Just set 'JAVA_HOME' to be /usr

i.e. /usr/bin/java/bin/java = wrong
/usr/bin/java (correct bit) - /bin/java (extra wrongness) = /usr (what you should set your JAVA_HOME to be)

mjohngren
Champ in-the-making
Champ in-the-making
Thanks.  I just tried that but still get the same result - catalina.out still says the same thing.  I also tried putting the export command that sets JAVA_HOME into alfresco.sh instead of .bash_profile, also with no change.  If I remove this altogether then the script says it can't run because JAVA_HOME is not set - I thought maybe it was already getting set somewhere else and so the two versions were getting combined.

What else can I do to track this down?

offtopic
Champ in-the-making
Champ in-the-making
$JAVA_HOME must be the path for the JDK, not the path for the java executable. Then, $JAVA_HOME/bin should be added to $PATH. Are you sure you have a JRE installed ?
What do you get when you type

ls -al /usr/bin/java
and
/usr/bin/java –version

?

jboggs
Champ in-the-making
Champ in-the-making
If you run /usr/bin/java do you get any output? The symlink for /usr/bin/java may exist but you might not have a JVM installed yet

mjohngren
Champ in-the-making
Champ in-the-making
Thanks, here are the results.  I installed the JDK prior to installing Alfresco, and that install seemed to go fine.

[root@sparkpress ~]# ls -al /usr/bin/java
lrwxrwxrwx  1 root root 26 Jul 11 21:02 /usr/bin/java -> /usr/java/default/bin/java

[root@sparkpress ~]# /usr/bin/java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode)

[root@sparkpress ~]# /usr/bin/java
Usage: java [-options] class [args…]
           (to execute a class)
   or  java [-options] -jar jarfile [args…]
           (to execute a jar file)

where options include:
    -d32          use a 32-bit data model if available

    -d64          use a 64-bit data model if available
    -client       to select the "client" VM

…. etc., etc…

I appreciate the assistance!

jboggs
Champ in-the-making
Champ in-the-making
Try setting your JAVA_HOME to your jdk directly

Mine is set to: /usr/java/jdk1.5.0_11/ but will vary depending on your jdk

offtopic
Champ in-the-making
Champ in-the-making
[root@sparkpress ~]# ls -al /usr/bin/java
lrwxrwxrwx  1 root root 26 Jul 11 21:02 /usr/bin/java -> /usr/java/default/bin/java

I presume that /usr/java/default is also a symbolic link. You could set JAVA_HOME to /usr/java/default in your .bash_profile

export JAVA_HOME=/usr/java/default

and I suggest you update the PATH as well

export PATH=$JAVA_HOME/bin:$PATH

makoildha
Champ in-the-making
Champ in-the-making
Add an export statement to your 'alfresco.sh' as below:
export JAVA_HOME=/usr

and try that - it worked for me.
Setting it at the terminal before running the alfresco meant it didn't work just as you say.

M

mjohngren
Champ in-the-making
Champ in-the-making
Thanks for all the suggestions.  jboggs's tip (setting JAVA_HOME directly to the JDK directory) got me past the error I was getting, so that suggests something amiss in the symlinks, and I'll see if these additional suggestions help fix that.  I had earlier tried putting the export statement into alfresco.sh, but that didn't change anything.

So now, I'm on to the next error!  Smiley Very Happy  This is what catalina.out is now telling me:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I am using a hosted virtual linux server, where I have root access but I think there is only 256MB of dedicated memory.  If I lower the maximum heap size for Java, will that fix this, or is there a minimum amount of memory required for Java/Tomcat/Alfresco to run?

Also, where do I change the max heap size?