
I join milist of alumny of my bachelor, the newest event is we gonna have scholarship for students and high school teacher, I want make a java sites for it, so I build the simple one, I create this document as if as you also want to create a simple java web application.
First I build in Ubuntu on my laptop, but I need internet for browsing, so I use on my office computer which is using Windows nowadays, infact last few months some pcs in my office re-using XP rather Ubuntu. So Im documenting my work on Windows and trying to write it as easier as I can. Contrary actually I prefer working on Ubuntu because of terminal and repository for downloading everything needed.
I use Appfuse 1.9.4 as wizard for creating java web application, I actually already made a start using Appfuse 2.0 with Maven rather Ant but it will need time for me for learning, so I decide it to use the older version, I already use this version on my previous project, so I will get the faster result, and it is much easier.
Here the list of needed things before working on this application:
1. java 1.6
2. mySql 5.1
3. appfuse 1.9.4
4. ant 1.7
5. tomcat 5.5
Here the steps:
1. Download them and install java and mysql, and extract for others in the prefer place.
2. When installing MySql server you gonna asked for root password, just type it as necessary, e.x: username=root, password=root
3. Open command prompt, write "java -version" and "ant -version", if the result is "is not recognized as an internal or external command," then we need do this things:
- open explorer, point to My Computer
- right click, Properties
- choose Advanced tab
- click Environment Variables
- in the System Variables box, the below one, click New
- Write Variable Name = ANT_HOME, Variable Value = D:\Java\apache-ant-1.7.0 (Or the prefered extracted path)
- Edit variable Path, copy the value into notepad, so we gonna have some line like this: C:\Program Files\.... it mention shortcut for the commands that our computer have, and then add this line : ";%ANT_HOME%\bin" for adding ANT_HOME
- restart computer
- for checking if we already have ant command in our computer type: "ant -version", and it should return some like this: "Apache Ant version 1.7.0 compiled on December 13 2006"
above steps set ANT_HOME and add "ant command" so we can call it from any place via command prompt.
4. Using command prompt, enter the extracted appfuse folder, for example on D:\Java\appfuse, and then type "ant new"
5. We gonna asked some questions:
[input] What would you like to name your application [myapp]? [myapp]
tunasbangsa
[input] What would you like to name your database [mydb]? [mydb]
tunasbangsa
[input] What package name would you like to use [org.appfuse]? [org.appfuse]
org.alits
It means I create new application named tunasbangsa, with database named tunasbangsa, and package named org.alits
6. System will do some operations, it needs some seconds, and if everything is correct, there will be a BUILD SUCCESFULL messages
7. Now you should be able to cd to your application and run: "ant setup test-all"
8. cd into the new application folder, type "cd ../tunasbangsa"
9. we already inside our application just type: "ant setup test-all", and it should be BUILD SUCCESFULL messages, if we got error something like username and password into mySql, change the password in properties.xml, by default the password is empty, we need to change same with our password, it's on line 53,
<property name="database.admin.password" value=""/>, set the password value = "root"
10. For viewing the result, run tomcat, enter into our extracted tomcat, for example in "C:\apache-tomcat-5.5.28", enter the bin folder, and run or double click startup.bat.
11. Goes to explorer, ie or firefox, type http://localhost:8080/tunasbangsa, it should shows the result same as in the capture above.
No comments:
Post a Comment