Newbie question about how to run play framework in Ubuntu 12.04

614 views
Skip to first unread message

kuan kuan

unread,
May 21, 2013, 9:04:33 PM5/21/13
to play-fr...@googlegroups.com
Hi, All:

Thanks for help.

I am just starting Play framework study. When I follow tutorial
http://www.youtube.com/watch?v=msJH-YLropw

In windows, it works verywell, but when I move to ubuntu12.04, I can only make the server started, but when I visit localhost:9000, it just stuck there.

Can anyone give me some clue?  I just wonder if there may be some write access problem?



Best,


K

Alexandru Nedelcu

unread,
May 22, 2013, 2:49:31 AM5/22/13
to play-fr...@googlegroups.com
I do not have the patience to watch that tutorial, however on Ubuntu the installation is easy.

First install OpenJDK 7 and make sure it's the default. It can work on JDK6, but I prefer going with 7. Open a terminal and type:

   sudo apt-get install openjdk-7-jdk

Then to make sure it is the default JDK used:

  sudo update-java-alternatives -s java-1.7.0-openjdk-amd64

After that download Play2 from: http://www.playframework.com/download

Uncompress it somewhere. Then you can just run the "play" executable included. It's also recommended to have that directory on your PATH, for easy access to the executable. I've got something like this included in my .bash_profile:

   export PATH="$PATH:$HOME/Apps/play2.1"

Also, skip video tutorials. Prefer written words instead: http://www.playframework.com/documentation/2.1.1/Installing

 




--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Alexandru Nedelcu
http://bionicspirit.com

Alexandru Nedelcu

unread,
May 22, 2013, 2:52:15 AM5/22/13
to play-fr...@googlegroups.com
And btw, that update-java-alternatives command may not work well, as you may not be on amd64. The following should work on whatever Ubuntu you have, provided that openjdk is already installed. Just copy/paste it to your terminal:

sudo update-java-alternatives -s `update-java-alternatives -l | grep java-1.7 | grep openjdk | awk '{print $1}'`

kuan kuan

unread,
May 23, 2013, 2:20:04 PM5/23/13
to play-fr...@googlegroups.com
Thanks Alex:

Your post helps. I think the problem is update-java-alternatives.

Finaly I got it.


Best,

K

Alexandru Nedelcu

unread,
May 24, 2013, 3:15:11 AM5/24/13
to play-fr...@googlegroups.com
Yeah, be careful on Ubuntu (or Linux in general) about what Java is
used, because on some versions at least GCJ is installed by default
instead of OpenJDK and GCJ sucks - though I think this is no longer so
in later versions of Ubuntu.

Also, I saw some people recommend against OpenJDK in production
systems, although I've never had issues with it and I don't really get
what the fuss is about. I think it has some performance issues with
Swing (the GUI toolkit) or something like that.

But just in case you have problems and want to experiment with
Oracle's JDK in a production (e.g. the non open-source version) you
can do so by adding the PPA of webupd8team, like so:

sudo add-apt-repository ppa:webupd8team/java

And then you can install it:

sudo apt-get update && sudo apt-get install oracle-java7-installer

After which you need to select it as the default, with
update-java-alternatives, just as I taught you :-)

For an automatically provisioned production system, if you want to
install stuff by scripts, like with Fab or Puppet, installing the JDK
with the above mentioned installer has a nasty habit of asking you to
agree with Oracle's restrictive terms and conditions, blocking your
script, so I'm going to leave this here for reference on how to
workaround that:

sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1
select true | sudo /usr/bin/debconf-set-selections

Again, I'm mentioning this just for reference in case you have
problems and want to see if it makes a difference, because the truth
is I trust OpenJDK more even in production, as I'm pretty sure that
the OpenJDK from Ubuntu receives security updates faster.
Reply all
Reply to author
Forward
0 new messages