English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-08-14 17:56:01 · 8 answers · asked by Hugo Afkhar 3 in Computers & Internet Programming & Design

8 answers

for suppose if u installed java software in any drive then note down the path where it is Installed .....!
eg: defaultly it will installed in c:\
then it's path to compile the java program is
c:\jdk1.4.0\bin\javac
then set the path to compile the program
from run logon to command prompt

c:\>set path=c:\jdk1.4.0\bin (then press enter)
c:\>set classpath=.;%classpath%;(press enter)
then compile ur program as
c:\javac (press enter)
c:\java
////gives output//////

2006-08-14 23:47:10 · answer #1 · answered by Anonymous · 0 0

Example 1
Type the following program and save it in a file with the name "First.java"

/*
This is my first java program
*/

// This is the class definition, First is the name of the class

class First{

// this program will begin with a call to main() defined as follows

public static void main(String args[]){
System.out.println("My first java program");
}
}
Compile the First program as follows
c:\jdk\application>javac First.java
I am assuming that First.java is in a directory called application
and application is in the jdk directory.
The java compiler creates a file called First.class in the directory
application (check that it is there !). This class contains
the program but in bytecode form ready to run. Run the program as follows
c:\jdk\application>java First
The output of this program is
My first java program
NOTE
1-java is case sensitive, first is different from First.
2-By convention the name of the file should match the name of the
class.

2006-08-14 19:32:21 · answer #2 · answered by kartoos5050 2 · 0 0

If you compile from the command line you first need to set your PATH environment variable to the location of your java compiler.

Then the code is

javac "Your Java File Name Here"

2006-08-14 18:34:15 · answer #3 · answered by geokavel 3 · 0 0

Thogh compiling java program can be done by command line, I recommend you using an IDE, this will make your work easier.
Their are very good free IDE foTry netbeans or eclispe

2006-08-14 18:06:28 · answer #4 · answered by Tanaeem 4 · 0 0

If you're a student ( if you're program's kinda small), it's best if you write it in a software (free) called BlueJ [site: www.bluej.org]. It allows you to easily compile ur program, and even tells you where you messed up!
Ciao!

2006-08-14 18:06:17 · answer #5 · answered by Anonymous · 0 0

it's better you go for some java course

2006-08-14 18:00:14 · answer #6 · answered by appu 2 · 0 0

you can visit sun official website for some tutorial

link: http://java.sun.com/

2006-08-14 19:49:09 · answer #7 · answered by Anonymous · 0 0

http://www.java.com

2006-08-14 18:00:53 · answer #8 · answered by Aki 4 · 0 0

fedest.com, questions and answers