Tuesday, July 28, 2009

About java compile how to compile or where is the probelem if?

i have a program on notepad app :


public class welcome{





public static void main(string[]){





system.out.println("welcome to java!");





}





}


then the response inC:command prompt:


C:\java%26gt;javac welcome.java


cannot read :welcome.java


1error

About java compile how to compile or where is the probelem if?
make sure u r saving the file in ur java installation folder's bin file example:: C:\\java\bin\ save ur files here then compile and run it.


second option to make the environment variable
Reply:i hope you are using winXP, not sure if this method works for older OS.





find the javac.exe file, by default is in 'C:\Program Files\Java\jdk1.5.0_09\bin'





open 'command prompt', drag and drop the javac.exe onto the command prompt and you will see the path there.





press 'space'





then find your welcome.java and drop it into command prompt, it will add another path after the javac.exe





Enter and you should have compiled the java file, by the way, System.out.println should have caps 'S'


No comments:

Post a Comment