help please
Author |
Message |
kishan25
|
Posted: Sun May 31, 2009 3:22 pm Post subject: help please |
|
|
can anyone tell me which program to download for java.
well I' am new t java, so can anybody tll me that from where can i download java for programming.
thank you |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DtY
|
|
|
|
|
chili5
|
Posted: Sun May 31, 2009 7:34 pm Post subject: RE:help please |
|
|
If you download Netbeans, it would come with the JDK and all the stuff you need to begin programming.
|
|
|
|
|
|
WOIKeller
|
Posted: Sun May 31, 2009 10:30 pm Post subject: Re: help please |
|
|
Honestly, call me archaic but I am strongly opposed to using NetBeans and other visual GUI IDEs. I much prefer the old fashioned notepad and command line compiler. But then this is probably due to the fact that my first computer ran DOS 5.0 |
|
|
|
|
|
zspamz
|
Posted: Mon Jun 01, 2009 7:49 am Post subject: RE:help please |
|
|
Try the java development tool |
|
|
|
|
|
chili5
|
Posted: Mon Jun 01, 2009 2:53 pm Post subject: RE:help please |
|
|
What Java development tool? ::confused: |
|
|
|
|
|
Insectoid
|
Posted: Mon Jun 01, 2009 3:39 pm Post subject: RE:help please |
|
|
It really depends on how much functionality you need. Some tools will run the compiler, have a built-in output window, will auto-complete method names, etc. Others, on the other hand, will just do syntax highlighting. |
|
|
|
|
|
DemonWasp
|
Posted: Mon Jun 01, 2009 3:59 pm Post subject: RE:help please |
|
|
To write Java code, you really only need a couple of things.
First, you need a text editor to read and write your Java files. You can use Notepad, but I would really recommend that you use something half-way competent. If you're on Windows (and you don't know vim) you should probably use Notepad++.
Second, you need the Java Development Kit (JDK) this includes the Java Runtime Environment (JRE) plus some additional tools. You can get the JDK from the SUN Website. Make sure you install the JDK; if you only have the JRE you won't be able to compile your programs.
Once you have these, you can write some sample code. Here's a Hello World program to get you started:
Java: |
public class HelloWorld {
public static void main ( String[] args ) {
System.out.println ( "Hello World" );
}
}
|
Copy-paste that into your text editor and save it as HelloWorld.java .
Open a command prompt (on Windows, use Start->Run, then enter "cmd.exe"). Use the cd command to navigate to the directory where you saved the file (and you can use the help command to learn more at any time).
Once you're in the same directory (you can check using the dir command). You can compile and run your program with the following (replacing HelloWorld.java with your own files; ignore the arrow, that's just the prompt):
code: |
> javac HelloWorld.java
> java HelloWorld
|
The first line (javac...) runs the Java compiler on HelloWorld.java to produce HelloWorld.class. You can then use the Java runtime (java) on the second line to run it. You should see the output (Hello World) on the next line, followed by a new prompt.
There, you've just gotten yourself set up to start working in Java. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|