Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Before I can write a Java program

Posted on 2004-10-30
21
Medium Priority
?
316 Views
Last Modified: 2013-11-23
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.
0
Comment
Question by:daveask
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 6
  • 2
  • +2
21 Comments
 
LVL 2

Accepted Solution

by:
SergeiKo earned 200 total points
ID: 12452330
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12452331
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
 
LVL 15

Assisted Solution

by:JakobA
JakobA earned 200 total points
ID: 12452351
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12452391
read this thread and decide yourself to use the  IDE

http:Q_21048347.html
0
 

Author Comment

by:daveask
ID: 12452602
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12452730
davesk, any all of them are mirror to the same
0
 

Author Comment

by:daveask
ID: 12452742
sudhakar_koundinya,

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

Expert Comment

by:sudhakar_koundinya
ID: 12452831
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12452854
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
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12452890
Netbeans u can get along with J2SE
http://java.sun.com/j2se/1.4.2/download-netbeans.html
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12452905
I am using Netbeans after discussed at
http:Q_21048347.html
0
 

Author Comment

by:daveask
ID: 12453570
OK, I installed J2SE v 1.4.2_06  SDK. Do I need to set something before I run my code?
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12453587
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
 

Author Comment

by:daveask
ID: 12453622
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
 
LVL 14

Assisted Solution

by:sudhakar_koundinya
sudhakar_koundinya earned 200 total points
ID: 12453653
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
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12453672
0
 

Author Comment

by:daveask
ID: 12453905
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
 

Author Comment

by:daveask
ID: 12453966
OK, now it is working, I even don't know why.......

Thanks a lot for all your helps.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12455374
:)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question