View Full Version : Running a simple Java Program and let's get excited!
masterof_none
05-06-2003, 12:57 AM
Hello, this is the summary of todays post:
1.Download you java runtime environment from Sun's website
2.write your own simple java program
3.Compile
4.Run
(I assume everybody use windows.for Mac user who use OS X, java is already there).
First step:
1. Go to http://java.sun.com
2.Click on J2SE download button, hit j2sdk1.4.1_03
3. click on the second link, and sdk (not jre,that's later).
4.fill up the info if you want, otherwise, simply skip to downlod.
5. read the agreement...blah blah blah. hit accept
6. Download, place it in your desktop
7.Double click on the blue icon on the desktop
8. Install...everything...just hit next.
9.Finish,to check , the directory should be there in C:\j2sdk1.4.1_03
Second:Write a simple java program
pull up Notepad,copy and paste this:
/*
*a simple Java program by (your name)
* * * /
public class HelloRC {
public static void main(String args[]) {
System.out.println("Hello RC!");
}
}
save it as HelloRC.java on your desktop .
ok, now go to My Computer, go to C hardrive (where you install your java directory). drag the HelloRC.jav icon from desktop to the C:\ directory.
now, pull up the Command prompt. usually it will say :
C:\Documents and Settings\Your Name>
run this command: cd .. //cd for change directory
once more : cd .. //note the tab after cd
now, your current dorectory should be at
C:\>
OK, now, type:
[]
dir
[/b]
you can see your HelloRC.java file over there. So far so good , now
run this command:
C:\>j2sdk1.4.1_03\bin\javac HelloRC.java
it will compile and produce HelloRC.class
now run this command
C:\>j2sdk1.4.1_03\bin\java HelloRC
it will produce
Hello RC! .
there we go!, that's your first java program. I'll tell you how to create a shortcut to get the java compiler run on current directory.
get excited!, drink a cup of Java.
post here if you have some problem.
Master of none...
wad shud we downloas now?
there is no J2SE version from 2003...
i found a 2006 version
it says wad JDK....
does it applies here?
thx for starting such interesting forum...
youngyew
18-08-2007, 08:02 AM
Master of none...
wad shud we downloas now?
there is no J2SE version from 2003...
i found a 2006 version
it says wad JDK....
does it applies here?
thx for starting such interesting forum...
Hi I wish I could help but I am not familiar with java programming. :(
Anyway please don't be fed up when nobody replies. It could be simply because nobody has an answer for you, especially for such a technical question. :)
youngyew
18-08-2007, 12:13 PM
how many mods r there in ReCom.org?
how many members r there?
sedangkan our country gt approxmately 500,000 malaysian born annually.....
y ReCom.org only gt 7000+++ members?
btw...only 10 active members....wahlao......really sarcastic......
is there enough promotion?
i don mind to help....but u ppl as mods should be more aggresive n active lar.....plz lar.......
don be so passive.....
ok?
malaysians really nid change d attitude.......
if nt Bolehland will still remain like dis.... (m*nd*r)....
soorry if i offended u guys.....
I am happy that you are concerned about ReCom's growth and activity. We would like members to be more active too, since the exchange of ideas and news is integral to our camaraderie.
However, there are a few possible reasons why ReCom are not active 24/7 everyday:
1. It's not exam / scholarship seasons, and exams and scholarship information is one of the main attractions for the forum visitors. Of course we would like people to discuss more serious, intellectual and not purely academic stuff; but we accept the fact that in general people are still more concerned about SPM, STPM and Paris Hilton's latest imprisonment rather than "yet another bigotry spewed out by our MPs".
2. There have been a recent change in the front page system, and now not every thread is shown on the front page when they are updated. There are a few reasons behind this front page system, and we concur that it's not perfect. However, a revamp is already under process and you will see an improved front page really soon.
3. Not everyone is free to go online and participate in a forum 24/7. Xon, take you for example, I am sure that you must have many other commitments, judging from your having 6 posts despite having joined the forum since March. The fact that people don't post here all day long don't necessarily imply that people are ignorant and naive; it might just mean that they have something else to do. I am sure you will agree and empathize, Xon.
For your information, there are about 10+ moderators in ReCom and a handful of them are active. Many of the moderators are already working and do not have much free time. There are 7000+ members but most members have less than 10 posts.
We appreciate your concern about ReCom's membership and activity; but we should look at improving the front page system and encouraging discourse. Recom is pretty well known and has been referred to by famous blogs like Education Malaysia, Tin Kosong, as well as The Star. There are also promotions in various student events like Discover, MSLF etc if I'm not mistaken.
hahazz...finally some acceptable reasons...
but...
y dont ReCom.org melantik more younger mods?
like those who juz complete form 5 o 6...o so on....
i hope ReCom.org will grow stronger n someday it may b untouchable.....
btw,i m a SPM Candidates dis yr...taking 12 subjctx......frm Kuching,Sarawak.....mayb i m lack in the mode of striving staright 12A1....kinda scary....
YouungYew,u make me kinteo ki....haiz.....
thanks for reminding me i gt BIG exam......
but i am particularly interesting in learning PROGRAMMING dis while......mock exam is in 3weeks time...><"
eve88
31-10-2008, 06:56 PM
hmm.. okay.. right... um... im trying to pick up java [umm i started off programming in javascript -- but im only capable of fairly basic stuff] ... and im confused about classes and objects (and inheritance, but better get the basics down first).
from what i can tell, a class provides instructions to build an object and defines the objects parameters and functions (methods).
so, umm.. what do you do with objects?
i have the feeling that im missing the point completely..............
masterof_none
31-10-2008, 08:21 PM
You know Xon, I think this is one of the few early posts I had in ReCom!. (Previously, it was called RC, so that's why I printed "Hello RC" there). I've also forgotten about it.
I haven't programming with Java for a long time, so I'm not dealing with it every day. (I'm dealing with C++ mostly).
But since we're discussing Java, let's try again.
Previously, Java folks always refer to J2SDK. But now, I think they rename it to just JDK.
You can download it here:
http://java.sun.com/javase/downloads/?intcmp=1281
Click on the second button and try writing the HelloRC program that I posted above. Let me know if it works or doesn't.
eve88
01-11-2008, 09:11 PM
yeah, the hello world program works...
(yay i finally wrote my first java program with its own GUI!!! *bounces*)
Congratz on entering Java
masterof_none
04-11-2008, 04:54 PM
eve88, that's great to know. Feel free to share the screen shot of your GUI program here too.
chenchow
05-11-2008, 01:27 AM
yeah, the hello world program works...
(yay i finally wrote my first java program with its own GUI!!! *bounces*)
Congratulations!
eve88
05-11-2008, 05:48 AM
lol. thanks! (and i am *never* ever going to start on another program with swing without an IDE)
link to screenshots : http://www.geocities.com/fun_krazy_k1d/PrimeUI.JPG
top to bottom:
1) on starting the program
2) the limits ... [this one took, like 10 minutes to run]
3) error!
vBulletin® v3.7.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.