Tuesday, August 29, 2006

Get started!

Its hard to get started, I admit that. It took me about 3 months to even start writing this ..sigh. Starting java programming? yes?, you should have known why you want to do this in the first place. To me now, i see java as a tool to learn about computer. I still remember my very first sip of java. It was an attempt to help someone with his java programming assignment. Yup, he asked in a chat room. Thats when i downloaded j2sdk 1.4.x, set them up and googled (if not mistaken) on how to run the java file in the first place. I didnt help him much actually, but hey, its the thought that counts :P

Anyways, from that experience there are only a few steps before you come to running your java program.
  1. Download the latest j2se sdk from Sun..
  2. Install it.
  3. Set the environment variables. For windows2000/xp users, go to MyComputer properties, edit the path variable. Note that, there are user variables set and system variables set. If you edit the system variable, every user loging on to the machine will be affected and if you edit user variable, only the user you are loging on-as will be affected by this action. At the end of the path variable, notice a semicolon (;), add the path of your j2se sdk bin here and end the line with a semicolon. i.e. C:\Program Files\Java\jdk1.5.0_06\bin.
  4. Reboot your PC.
  5. Type javac at your command prompt, you should see Usage: javac ...
  6. If you like, type just any other file name with exe extension u can found in the path of your j2se sdk bin i.e. java, jarsigner, jstatd, jar, etc ...
  7. Get a java code, compile it with javac command. Here's a classic Hello world for you, scroll down a bit. Save it as HelloWorld.java
  8. In the command prompt, navigate to where you store HelloWord.java, i.e. cd /d C:\daJavaCode\
  9. Type javac HelloWorld.java
  10. Look in your working directory just now i.e. C:\daJavaCode, notice there is a HelloWorld.class file.
  11. This shows your compilation is successful.
  12. Now, while your command prompt is still pointing on the working directory, type java HelloWorld
//HelloWorld.java
public class HelloWorld{
public static void main(String[] a){System.out.println("if you can see this, you are Hot!");
}
}

So, there you have it. I know this is not much, but enough to get you started with java (if you have not yet) and me started with this blog :D I intend to continue this blog as i continue learning..
I welcome your comments, suggestions, questions.. lets hear them here..

To those who are yet to get started, these are the same steps (well, pretty much) i walked through and today, i provide commercial java solutions.

Last but not least, seriously, why you want to do anything with java programming?

Cheers!





Thursday, June 22, 2006

da java code

hi everyone, happy java coding :D