running a java program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samson jose
    New Member
    • Jan 2016
    • 1

    running a java program

    What is the solution when confronted with a message like this, javac: file not found usage: javac <options> <source files> use -help for list of possibles options.
    Even though java is fully installed.
    The above message is gotten when trying to compile a program
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    it means that you have a typo in the file name and/or path to the file that you want to compile or that the file itself doesn't exist.

    Comment

    • chaarmann
      Recognized Expert Contributor
      • Nov 2007
      • 785

      #3
      Please note:
      • Put the file name in quotation marks if it contains spaces.
      • I advise to use underscores instead of spaces in file and directory (folder) names.
      • In Java, the file name should always be the class name.


      wrong:
      Code:
      javac c:/my directory name with spaces/HelloWorld.java
      This would tell the copiler to compile 4 files:
      1. c:/my
      2. directory
      3. name
      4. with
      5. spaces/HelloWorld.java


      correct:
      Code:
      javac "c:/my directory name with spaces/HelloWorld.java"

      Comment

      Working...