Minggu, 27 Januari 2013

Java Web Development - Starting

The aim of this thread is to gather useful information in regards of Java web development. If you know some tips and tricks, tutorials or any interesting links that has not been already mentioned in previous posts please share with us (please always check to avoid double posting).
Please DO NOT post questions in this thread and also to not post any links leading to websites associated with you as this will goes against forum policies.
What you need for Java web development:Some previous Java knowledge, if you don't know Java you better start reading Starting "Java" [Java tutorials / resources / faq]
Installation of Java (instructions here)
Installation of either Java web server also know as J2EE server(JBoss, WebLogic, WebSphere) or web container (Tomcat, GlassFish) - [Quick jump to post here]
Access to database (MySQL, Oracle, HSQLDB etc.) - [Quick jump to post here]
Optional tools (Ant, Maven, Subversion) - [Quick jump to post here]
Your favourite IDE (IntelliJ IDEA, Eclipse, NetBeans, etc.)
Installing Java
Ubuntu
Install
  1. sudo apt-get install sun-java6-jdk
Java is installed under /usr/lib/jvm/java-6-sun-1.6.0.15 (version number 1.6.0.15 my change over time)Note please that there been some changes in recent release of Ubuntu 10.04. To install Java you need first make changes in repositories as follows before you can run above installation command
  1. sudo add-apt-repository deb http://archive.canonical.com/ lucid partner”
  2. sudo apt-get update
Set environment variable
Many tutorials on the internet will tell you that to set environment variable you need to only type EXPORT command followed by variable name and a path associated with it in your command line/terminal, but they fail to mention that this is only temporary measurement. To make your environment variable permanent in your system you need to edit bashrc file.
  1. sudo gedit ~/.bashrc
  2. //add at the end of the file
  3. export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15
  4. export PATH=$PATH:$JAVA_HOME/bin
Test
  1. java -version
  2. echo $JAVA_HOME
  3. echo $PATH
Windows XP
Download latest installation package from here at the time of writing this entry it was JDK 6 Update 17. Double click and follow installation instructions (may want to uncheck the option for installing additional tool bars for browsers).
Set environment variables
Start > Control Panel > System or just press Window key(left down between Ctrl and Alt) + Pause/Break(up right at the end of F1-F12 row) and you will get System properties window. Here select Advanced tab followed by Environment Variables button. In system variables you should already have existing entry for PATH so click Edit and append ;C:\Program Files\Java\jdk1.6.0_16\bin pressOK. Now press New and in Variable name type JAVA_HOME and in Variable value type C:\Program Files\Java\jdk1.6.0_16 and press OK.
Test
  1. java -version
  2. echo %JAVA_HOME%
  3. echo %PATH%


Tidak ada komentar:

Posting Komentar