July 14, 2010

PlayFramework on my linux !!

Hey everyone,
Along with my recent adventures with play,I decided to force my self to become more proficient with Play.For those who don't know about the play ,

"The Play framework is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures." I think its nice framework to make web-based application with the help of using any editor like Komodo or Emacs...rather than using "DotNet technology or NetBeans with JAVA" for making the Web-Based application.

There are often religious-grade battles those who believe in .net framework and NetBeans,another surviving application development technology, editor and framework for making web-based application using JAVA environment or etc.

I'm not trying to get into any debates about which is better and I'm not interested to know why I should not be using the .Net Technology or NetBeans for my project.
so,if u still feel like I need to be set straight,Send me an email

Anyway,
I have been using Linux since about 2007.
I had JAVA self extracting file which was gave me Jitendra Vishwakarma.
So,I tried to run play in my Linux with the help of documentation.
I had java ,but "i don't know how to install it?"

Ever since I first started using Linux, I have been using Terminal for installing most of software's and applications...at this time also ,really I don't know many commands of Linux.

So, once again I started searching on Google about "how to install java on Linux ". I found the solution for it and I dabbled with a tutorial here and there...and finally I get the java on my Path.

My recent experimentation with JAVA Installation has proved to be very fruitful, if I do say so myself.


If any one much interested to know "how to install the java on Linux?",then follow the instruction and commands.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Download and copy jdk-6-linux-i586.bin to $HOME/src (or a location of your choice).

type>>

% su -

(some linux are accept the "su" command and some are not,So in case of this problem use the "sudo" command.And it will prompt you for a enter admin password,once u have entered the password it will not ask u again and again during the editing,deleting,moving the files .)

"I don't know much about the RedHat and the Solaries,but ubuntu based linux accept the "sudo" command...."

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


#su (or sudo)
# mkdir /usr/java (if it doesn't exist or start the line with "sudo")
# mv $HOME/src/jdk-6-linux-i586.bin /usr/java (if it doesn' start line with "sudo")
# cd /usr/java (if it doesn' start line with "sudo")
# chmod +x jdk-6-linux-i586.bin (if it doesn' start line with "sudo")
# ./jdk-6-linux-i586.bin


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It will extract all the files of java and install it in your system.

Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).


PATH=$PATH:/usr/java/jdk1.6.0/bin
JAVA_HOME=/usr/java/jdk1.6.0
export PATH



for more information about Java Installation try this Enterprise Java for Linux HOWTO.


After installing the java,I started developing the Simple Web-Application in Play.
Here are the steps of creating application.

Installation of play is very simple.
Just download the latest binary package from the download page and unzip it to any path.Play use the command line a lot, it’s better to use a Unix-like OS.

Play is correctly installed, it’s time to create the hello world application. Creating a Play application is pretty easy and fully managed by the Play command line utility. That allows for standard project layouts between all Play applications.

Open a new command line and type:


$python play new helloworld


It will creates a new helloworld application.
now we need to test it,either its working or not?

For run the application>

Open a new command line and type:

$python play run helloworld/



Play will now load the application and start a Web server on port 9000.
You can see the new application by opening a browser to http://localhost:9000

Here is the snap of the simple " hello-world "application and "how to set the JAVA_HOME path in snap"
And follow the Documentation for making "helloworld" application.

Click On the Image
To See The Tested "Hellowrld" Application.

Follow Us @soratemplates