The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

how to run the java program?

Posted by Krishna Surisetty on February 14, 2001 at 3:23 PM

> Hi

> You can follow the following steps to compile and run your java program.
> 1. Suppose c:\myjava is the directory where you store all your
> java files. So if you have a java program "Hello.java" then its
> path should be c:\myjava\Hello.java .
> 2. Set the PATH ( I am saying PATH not the ClassPath ) environment
> variable to your "java home/bin" i.e. your PATH setting should
> look like PATH = %PATH%; c:\jdk1.3\bin;
> 3. On DOS prompt when you try to compile or run java program then change
> your directory to "C:\myjava" i.e. your C: prompt will look like
> C:\myjava>
> 4. First compile your .java file like
> C:\myjava>javac Hello.java
> 5. To run it
> C:\myjava>java Hello
> If you follow above steps to compile and run java
> programs you don't need to set or pass ( using -cp switch ) any CLASSPATH while compiling your java programs.

> Thanx
> Kishori






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us