954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

java Help !

hi gyz, i've got my first Assignment of java. first i do coding plz take a look. : /* The HelloWorldApp class
implements an application that simply
displays "Hello World!" to the standard
output. */
public class HelloWorldApp{

public static void main(string[]args){

//Display the string.No global main System.out.println("Hello World!");
}
}

After this when i've try to compile the it like this : first i dwonload jdk 5.0 and i've save file the name of "HelloWorldApp.java" then i've open the comand prompet and wrote javac HelloWorldApp.java there comes an error like 1 error . where i do mistake plz guide me.
thanks in Advance

us0343
Newbie Poster
20 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Post the error message here..
and

string[]args)

String is a class . it should be capital.

public static void main(String[] args)
harinath_2007
Posting Whiz
355 posts since Aug 2010
Reputation Points: 78
Solved Threads: 36
 

when i'd compile by javac HelloWorldApp.java the error becomes :

error: cannot read: HelloWorldApp.java 1Error
us0343
Newbie Poster
20 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

well, that just means the compiler either can't find the source file or you've got the file permissions set for it to be not readable for the compiler.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

If you are compiling from command prompt , make sure that you are in the same directory where your source file is present.

harinath_2007
Posting Whiz
355 posts since Aug 2010
Reputation Points: 78
Solved Threads: 36
 

you right sir but,
right now,I've copy and paste that file into bin folder of jdk.
then i've copy the path of bin folder and wrote in comand prompt :

cd path of bin folder

then hit 'enter' its done and after that when i try to compile again same Error becomes again.
one thing when i ignore that error and do the next step wrote java HelloWorldApp.java and hit the 'enter' as a result my coded notepad file names HElloWApp.java opens.
i think i should try to listen the basic lecture again.

us0343
Newbie Poster
20 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: