Tuesday, April 7, 2009

J2EE Lesson 1 - Machine Setup

On this lesson, we'll work on setting up your computer to run and create java programs. Bale ito ang mga kelangan natin:

1. JDK - yung box na ang title ay "Java SE Development Kit (JDK)", click mo yung download na link. Kindly take note na "Java SE Development Kit (JDK)" at hindi "Java SE Runtime Environment (JRE)" ang title nung box na iki-click yung download na link. Bale ang JDK ay yung gagamitin nating compiler at 'runtime environment' (yung program na magra-run ng application).

2. Eclipse - ito yung IDE (Integrated Development Environment) na gagamitin natin. Ano ba ang IDE? An IDE or Integrated Development Environment is a program that provides an environment for the development of softwares and handles interactions with the compiler. Hence, sa IDE tayo magdedevelop at magla-lunch ng program at deployment sa Web Server. Actually, optional ang paggamit ng Eclipse sa Java programming. Kasi pwede naman gumamit ng notepad and command line. Kaso, on my personal view, sa totoong development environment, wala naman gumagamit ng notepad lang as the primary tool. Eclipse also makes develoment easier kasi hindi na kelangan mag issue ng mga java at javac command sa cmd. Its a good thing to know how to compile and run java programs using a command line but is not necessary to develop Java programs.

Pwede din hindi Eclipse ang gamitin. Pwedeng JCreator, NetBeans, BlueJ or even IBM's Websphere Studio Application Development (WSAD) and Rational Application Development (RAD) kung meron kang license at installer from IBM, atbp. Pero sa mga tutorial na to, I use Eclipse. Simply because Eclipse is easy to use at hindi masyadong mabigat sa system. Open source din sya at industry standard din like NetBeans. Even IBM's WSAD and RAD are based on Eclipse's platform.

3. Tomcat - 'To yung gagamitin nating Web Server. Since we'll be working on J2EE, dapat meron tayong Web Server. Ang i-download nyo ay yung 'Core' tapos yung zip file.


Installation:
1. Installation of JDK is pretty much straight forward. Just click on the 'next' or 'ok' button. In my case pati sa mga screenshots ko, hindi ko sya nilagay sa 'Program Files'. Gusto ko kasi magkakasama silang lahat at para madali kong ma-manage. Gumawa ako ng folder named 'APPS' tapos dun ko nilagay.

2. Installing Eclipse is even easier. Just extract the zip file and you're done.

3. Same thing sa Eclipse, just extract and you're done.


Configuration:
1. Go to 'Control Panel' -> 'System' -> 'Advanced' tab
2. Click 'Environment Variables'. May lalabas na window kagaya nito:
3. Click nyo lang yung 'New' button sa may 'System variables' na group. Naka red na box sa screenshot.
4. Sa 'Variable name:', lagay nyo lang: 'JAVA_HOME' at sa 'Variable value:' naman ay yung path kung san mo ininstall ang JDK. Kagaya nito:
5. Click 'Ok'
6. Click nyo ulit yung 'New' button. This time, 'CATALINA_HOME' naman ang ilalagay at yung 'Variable value:' ay kung saan saan nyo inextract yung tomcat. Sa case ko, I extracted it under 'APPS' folder, so ang 'New System Variable' ko ganto:


That's it pancit. Oks na tayo sa config. Paki restart na ang PC. :)

No comments:

Post a Comment