July 16, 2010

#

Another adventures and experiments with Play on my Linux !!

Hey everyone,
Along with my recent adventures and experiments with Play, I decided to force myself to become more proficient with Play. For all those who don't know what “Play” is , I will give u all a just of it..

The Play framework is a clean alternative to bloated Enterprise Java stacks.

I think its very nice framework to make web-based application by using any editor like Komodo or Emacs,and it provides libraries for database access,error handling,templating framework and session management,security,an automated test suite, a shiny web interface and an administration area and it also provides the codes for reuse.


so, if u still feel like I need to be set straight,any suggestion or any question,Send me an email.

Anyway,
I have been using Linux since about 2007.
I had JAVA self extracting file which was given to me by Mr. 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...even today I do so.. ,
really I don't know many commands of Linux.


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

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

If anyone is much interested to know "how to install the java in 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 use "su" command and some don’t. So in such a case, 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 as I have worked on ubuntu based linux, it 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 Play download page and unzip it to any path. Play uses command line a lot for creating,running and testing the application,it’s better to use a Linux or MacOS ,if you are using windows,its also fine.

Play is correctly installed,now start 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 if 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