Before I can write a Java program

Hi Experts,

I knew little Java a few years ago and forgot all of them now.
However, I need to write a (very simple) Java program at the moment!
Can you suggest any software for editing, compiling and running Java codes? Where to download and how to install for my WindowsXP?

Thank you in advance.
daveaskAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SergeiKoConnect With a Mentor Commented:
Hello, daveask.

For very simple program I would use any text editor with tokens colouring. :-)

Also you can look at
http://www.eclipse.org/


Regards.
0
 
petmagdyCommented:
offcourse Eclipse 3.0.1 works on XP and it is free!

http://www.eclipse.org/downloads/index.php

also Netbeans is excellent and free:

http://www.netbeans.org/
0
 
JakobAConnect With a Mentor Commented:
I would recommend notepad for writing and editig the .java files

along with the basic java development package from sun (contains compiler, virtual machine, etc)
http://java.sun.com/j2se/1.4.2/download.html      "J2SE v 1.4.2_06  SDK"

If you are going to write many such programs it might be worthwhile to learn the rules of Jbuilder or Forte or some other develpers package; but it is not worth it if it is just one little program.

regards JakobA
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
sudhakar_koundinyaCommented:
read this thread and decide yourself to use the  IDE

http:Q_21048347.html
0
 
sudhakar_koundinyaCommented:
0
 
daveaskAuthor Commented:
Thanks a lot for your helps!

Only one file I need to dowload and can do compiling and running my Java code?
http://java.sun.com/j2se/1.4.2/download.html      "J2SE v 1.4.2_06  SDK"

I am confused what I should download here:
http://www.eclipse.org/downloads/index.php
I saw a few files.....
0
 
sudhakar_koundinyaCommented:
0
 
petmagdyCommented:
davesk, any all of them are mirror to the same
0
 
daveaskAuthor Commented:
sudhakar_koundinya,

So, I need to download eclipse-SDK-3.0.1-win32.zip and J2SE v 1.4.2_06  SDK?
0
 
sudhakar_koundinyaCommented:
0
 
sudhakar_koundinyaCommented:
hmmm download J2SE v 1.4.2_06  SDK  that is the better choice

>>So, I need to download eclipse-SDK-3.0.1-win32.zip and J2SE v 1.4.2_06  SDK?

So, You must
0
 
sudhakar_koundinyaCommented:
Netbeans u can get along with J2SE
http://java.sun.com/j2se/1.4.2/download-netbeans.html
0
 
sudhakar_koundinyaCommented:
I am using Netbeans after discussed at
http:Q_21048347.html
0
 
daveaskAuthor Commented:
OK, I installed J2SE v 1.4.2_06  SDK. Do I need to set something before I run my code?
0
 
sudhakar_koundinyaCommented:
I don't know which IDE you are preferring.

If  you have installed Eclipse/Net Beans IDE. You don't need any further software


OK,

If youd did not installed Eclipse like IDE then write a program in Notepad

and you need to compile them at command prmpt.

Regards
Sudhakar
0
 
daveaskAuthor Commented:
sudhakar_koundinya,

Thank you.
No IDE yet! I cannot wait it and want to have a try now. Can you tell me what command I need to compile and then run a file: and what extention I shold give this file?
0
 
sudhakar_koundinyaConnect With a Mentor Commented:
1. Your first program -> Write  below one in Notepad

public class HelloWorld
{
     public static void main(String s[])
     {
             System.out.println("Hello World!!! ");
     }
}

2. Now save this Program as HelloWorld.java
 
(Take care that class name and File name should be same.)

I am assuming You saved the program   in c:\ and Installed the SDK in c:\J2SE1.4

3. Now set the path to Java Installed diractory from command prompt

set path=%path%;c:\J2SE1.4\bin

4. Now set the classpath to Your Installed SDK from the command prompt

set classpath=%classpath%;c:\J2SE1.4\jre\lib\rt.jar;c:\J2SE1.4\jre\lib\

5. Now compile your Java file from command prompt
(Assuming you are c:\ and file is saved as c:\HelloWorld.java)

javac HelloWorld.java

6. Now Execute the program from command prompt

java HelloWorld

Take care that class name and File Name should be same. And Java is case Sensitive Language.

That's it

Welcome to Java World and Happy Programming

Regards
Sudhakar



0
 
sudhakar_koundinyaCommented:
0
 
daveaskAuthor Commented:
Thanks a lot!
I have done the 'set path' and 'set classpath', I found MyClass.class after javac, but when do java, I got
Exception in thread "main" Java.lang.NoClassDefFoundError: c:\...MyClass

MyClass.java is my program, do you think I did something wrong in it?
0
 
daveaskAuthor Commented:
OK, now it is working, I even don't know why.......

Thanks a lot for all your helps.
0
 
sudhakar_koundinyaCommented:
:)
0
All Courses

From novice to tech pro — start learning today.