# javac.exe automatically closing



## cooldudie3 (Jan 3, 2009)

I am new to Java and I have downloaded the Java SE 6 SDK. I have finished programming my EXAMPLE.java program but I run javac.exe, it doesn't work. It opens, but after a second the command prompt window closes. I try many times but still does not work. Then I try to drag the .java file to the javac.exe. I get a .class file(successful) but according to "Java: A Beginner's Guide 4th Edition", I can open the javac.exe and type a command so it works. It is time consuming to drag the files. And when I run the .class file, java.exe does not work. The same thing happens, the window opens for a second, then closes. But there are like words before it closes but it is too fast to be seen. This is annoying and I am disappointed in Sun/Java. Does anyone have a solution?
JDK 6 Update 11 installed
Windows XP Pro SP3 system

Update:
I have scanned javac.exe with KAV and reported no viruses, trojans or malware.
I have tried to "Print Screen" but it's waay to fast!


----------



## chandru.in (Jan 3, 2009)

cooldudie3 said:


> This is annoying and I am disappointed in Sun/Java.


You are new to something and don't know how to use it.  Then you blame it and get annoyed and disappointed with it.  That is very funny.  

Could you please tell me where you learnt Java from?  These kind of knee jerk reactions will not help you learn anything.


----------



## cooldudie3 (Jan 4, 2009)

I have a book!! "Java: A Beginner's Guide"


----------



## Faun (Jan 4, 2009)

well...i can understand your problem. Please stop java programming now. Thats the very best advice I can give...lol


----------



## vamsi360 (Jan 4, 2009)

T159 said:


> well...i can understand your problem. Please stop java programming now. Thats the very best advice I can give...lol



lol


The problem is you have to open javac.exe in command prompt dude and you have to give one parameter.
Add C:\Program Files\Java\jdk1.6.0\bin to Path section under system variables in environmental variables ( in my computer propreties )

Now got cmd where you saved your .java file and type

javac filename.java and then
java classname

COOL!


----------



## Faun (Jan 4, 2009)

^^actually some people like to double click every exe they see and command line is like a call of chuthullu for them.

@cooldudie3 if you really want to learn a programming language then first get familiar with basic os concepts.

You may have to set the classpath for java bin directory in win xp or any other os before you may be able to compile it from command line directly.

Open a command prompt. To do that type "cmd" in run dialog box (access it from Start menu).
...oh snap it will be a pain to write that all down.

Kindly refer to the tutorial (written by me for beginners like you)

Link: *t.webofgoo.com/2008/01/03/a-beginners-appraoch-to-java/
*t.webofgoo.com/2008/01/03/a-beginners-appraoch-to-java/


----------

