Play-Framework can't seem to find Java executable.

1,126 views
Skip to first unread message

jbran...@gmail.com

unread,
Mar 14, 2011, 11:09:32 PM3/14/11
to play-framework
I have seen a similar thread on this, but it was for Windows and it
didn't help me much. Here is the issue that I am experiencing. I have
an Ubuntu web server and I just installed Play on it. I installed Play
in my var/www directory, but because of permissions, I am forced to do
the actual app creation in my account directory. So I navigated to my
account directory and typed "/var/www/play/play new myApp" and then
named the app. A simple 'ls' shows that it was created successfully.
The tutorial I am following now instructs me to run the app, so I type
"/var/www/play/play run myApp", it begins to run it, but then errors
out with the following message: "Could not execute the java
executable, please make sure the JAVA_HOME environment variable is set
properly (the java executable should reside at JAVA_HOME/bin/java)."
Any suggestions on how to fix this?

Steve Chaloner

unread,
Mar 15, 2011, 4:32:37 AM3/15/11
to play-framework
I think it's better to not have play in your /var/www folder -
instead, put it in /opt, /usr/local, /usr/share or somewhere similar.

Things to check:
1. Do you have JAVA_HOME set? Use "env" or "echo $JAVA_HOME" to check
this
2. Which user account is being used to start your app? Does that user
have JAVA_HOME set?

- Steve

On Mar 15, 4:09 am, "jbranch...@gmail.com" <jbranch...@gmail.com>
wrote:

jbran...@gmail.com

unread,
Mar 15, 2011, 10:53:11 AM3/15/11
to play-fr...@googlegroups.com
I can try moving Play to a different directory, but in the meantime I am still getting the same error message. I have ensured that JAVA_HOME is set to "/usr/lib/jvm/java-6-openjdk/bin". However when I try to run the Play application that I have created, it still says "Could not execute the java executable, please make sure the JAVA_HOME environment variable is set properly (the java executable should reside at JAVA_HOME/bin/java)."

From this same directory, I am able to successfully compile and run Java files, so I don't think there is actually anything wrong with the JAVA_HOME path. Any other ideas?

Steve Chaloner

unread,
Mar 16, 2011, 2:53:03 AM3/16/11
to play-framework
Install play in your /tmp directory, set PLAY_HOME to point to it,
make sure PLAY_HOME is on your path and try again. Let me know what
happens.

- Steve

On Mar 15, 3:53 pm, "jbranch...@gmail.com" <jbranch...@gmail.com>
wrote:

Pascal Voitot Dev

unread,
Mar 16, 2011, 3:41:49 AM3/16/11
to play-fr...@googlegroups.com, jbran...@gmail.com
Just a quick suggestion: generally the JAVA_HOME doesn't point to "/usr/lib/jvm/java-6-openjdk/bin" but to "/usr/lib/jvm/java-6-openjdk/" without BIN, isn't it?

On Tue, Mar 15, 2011 at 3:53 PM, jbran...@gmail.com <jbran...@gmail.com> wrote:
I can try moving Play to a different directory, but in the meantime I am still getting the same error message. I have ensured that JAVA_HOME is set to "/usr/lib/jvm/java-6-openjdk/bin". However when I try to run the Play application that I have created, it still says "Could not execute the java executable, please make sure the JAVA_HOME environment variable is set properly (the java executable should reside at JAVA_HOME/bin/java)."

From this same directory, I am able to successfully compile and run Java files, so I don't think there is actually anything wrong with the JAVA_HOME path. Any other ideas?

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

jbran...@gmail.com

unread,
Mar 19, 2011, 8:21:21 PM3/19/11
to play-fr...@googlegroups.com
I moved play to my tmp directory and then I modified my etc/environment to look like the following:

PLAY_PATH="/tmp/play"
JAVA_HOME="/usr/lib/jvm/java-6-openjdk"
PATH="$PLAY_PATH:$JAVA_HOME:$JAVA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

However, I then went to use the play command in my account's directory and it couldn't recognize it. Am I even modifying the right file?

jbran...@gmail.com

unread,
Mar 19, 2011, 8:24:16 PM3/19/11
to play-fr...@googlegroups.com, jbran...@gmail.com
This seemed to help because it isn't having trouble finding java anymore. Thanks for your help!
Reply all
Reply to author
Forward
0 new messages