title: Compiling java program using javac from command prompt
body: <p>I have new laptop on which I have installed jdk1.8.0_91 and jre1.8.0_91.
  Both are in the "C:\Program Files\Java" folder.
  I have NOT set any classpath or any environment variables.
  I wrote a a HelloWorld.java program and saved it in "C:\my Data"   folder.
  I then went to Command Prompt using cmd.
  Then  I changed the current directory to "C:\Program Files\Java\jdk1.8.0_91\bin"  ..since here is the javac.exe</p>
  
  <p>and then tried to compile my HelloWorld program and its giving the following error -</p>
  
  <pre><code>C:\Program Files\Java\jdk1.8.0_91\bin&gt;javac -sourcepath C:\my Data\HelloWorld.java
  javac: invalid flag: Data\HelloWorld.com
  Usage: javac &lt;options&gt; &lt;source files&gt;
  use -help for a list of possible options
  </code></pre>
  
  <p>I am not sure whether I am correctly using the "sourcepath" or not...</p>
  
  <p>How should I tell the compiler where my source file is ?(and I want to resolve this without setting any classpath or any environment variables)</p>