Re: Java on command prompt
Why did you install netbeans if you want to compile & run from the command prompt?
What happens when you type 'javac' at the command prompt?
Re: Java on command prompt
first change the dir to the location of saved .java file using the cd on your terminal application or command prompt.
then type javac "asdf.java" whatever, then type java "asdf" and it will run
Re: Java on command prompt
I installed netbeans for compiling java program but after knowledge of java program through command prompt then.Dear friend I saved java program in D location as D:\mywork , When I used command prompt to write d: & enter then get the information D:\> but from here i am facing problems to use command prompt for compilation & run.
Re: Java on command prompt
Okay but where I save the java program has saved in D location.Shall I save the program in C drive?U please tell me all steps....
Re: Java on command prompt
Duplicate thread with
http://www.javaprogrammingforums.com...reply-plz.html
See other thread for how to create first HelloWorld program.
Re: Java on command prompt
When I use the program on command prompt then get the following statements as below.Please get me & give me reply.
C:\Documents and Settings\Administrator>d:
D:\>cd\mywork
D:\mywork>dir
Volume in drive D has no label.
Volume serial number is B21B-4805
Directory of D:\mywork
08/16/2011 07:55 PM <DIR>
08/16/2011 07:55 PM <DIR>
08/10/2011 01:58 AM 105 Helloword.java
1 Files<s> 105 bytes
2 Dir<s> 88,871,649.280 bytes free
D:\mywork>
Re: Java on command prompt
Quote:
When I use the program on command prompt
What program are you using?
Did you read the tutorial posted on post#2 on the other thread?
Re: Java on command prompt
I 've installed Java software( jdk-6u11-windows-i586-p and
netbeans-7.0-ml-javaee-windows) on my computer.When I use the program on command prompt then get the following statements as below.Please get me & give me reply.
C:\Documents and Settings\Administrator>d:
D:\>cd\mywork
D:\mywork>dir
Volume in drive D has no label.
Volume serial number is B21B-4805
Directory of D:\mywork
08/16/2011 07:55 PM <DIR>
08/16/2011 07:55 PM <DIR>
08/10/2011 01:58 AM 105 Helloword.java
1 Files<s> 105 bytes
2 Dir<s> 88,871,649.280 bytes free
D:\mywork> .
No I didn't read till now.u send here & tell me for compilation & run on command prompt.Thanksssss
Re: Java on command prompt
If you have any specific questions or problems after you read the Tutorial, please post them here.
Re: Java on command prompt
Quote:
Originally Posted by
Tanmaysinha
When I use the program on command prompt then get the following statements as below.Please get me & give me reply.
C:\Documents and Settings\Administrator>d:
D:\>cd\mywork
D:\mywork>dir
Volume in drive D has no label.
Volume serial number is B21B-4805
Directory of D:\mywork
08/16/2011 07:55 PM <DIR>
08/16/2011 07:55 PM <DIR>
08/10/2011 01:58 AM 105 Helloword.java
1 Files<s> 105 bytes
2 Dir<s> 88,871,649.280 bytes free
D:\mywork>
first the HelloWorld needs to be in file of same name, you have Helloword.java should be HelloWorld.java
once you have renamed it, type at the prompt
Code :
d:\mywork>javac HelloWorld.java
Java is case sensitive.
next type: java helloworld
and you should have it.
Re: Java on command prompt
Go in the directory where your jdk is installed.
Place your .java file in bin folder located inside jdk folder.
Go to command prompt and move to jdk\bin directory
And then write javac className.java
java className
Or set your environment variables such as JAVA_HOME, CLASSPATH
Re: Java on command prompt
Quote:
Place your .java file in bin folder located inside jdk folder.
Only for testing. Do not leave any of your files in the JDK folder.