Skip to main content

Help

4 replies [Last post]
javamaia
Offline
Joined: 2010-06-07
Points: 0

Hello I want to start to learn Java, so I took some books and internet Web sites.

I installed the new jdk.1.6.0_20 in my computer its is in C:\Program Files\Java\jdk1.6.0-20

I created a file called HelloWorld.java as you can see below I saved the at the folder
C:\Program Files\Java\jdk1.6.0-20\bin

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}//End of main
}//End of HelloWorld Class

So I go to the DOS prompt at C:\Program Files\Java\jdk1.6.0-20\bin to compile by typing: javac HelloWorld.java

The computer return the msg.:
HelloWorld.java:1: error while writing HelloWorld: HelloWorld.class
public class HelloWorld (
1 error
Is anyone can help me what is going wrong, what should I do?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aaroeiraa
Offline
Joined: 2004-11-26
Points: 0

Maybe you do not have access to write in this folder

mido_4ever
Offline
Joined: 2010-10-16
Points: 0

If you are looking for a document generation system on Java, take a look at this http://www.javadocgen.info . It has basic info on all the vendors. It makes for a great starting point.Document generation is the most thorough and efficient means of automating documents, and without it, businesses would waste critical resources.

gegemartinelli
Offline
Joined: 2010-09-23
Points: 0

I would suggest you use a work directory, for example c:\mywork
and put all your stuffs in it. So you can keep the java directory clean.

Then, do from the dos prompt ::

c:
cd \mywork
\Program Files\Java\jdk1.6.0-20\bin javac HelloWorld.java
then if everythink's OK :
java HelloWorld

gegemartinelli
Offline
Joined: 2010-09-23
Points: 0

Sorry, to execute you should type :

\Program Files\Java\jdk1.6.0-20\bin java HelloWorld