Results 1 to 5 of 5

Thread: Javac Issues

  1. #1
    Join Date
    Jan 2014
    Beans
    6

    Javac Issues

    I need to be able to compile .java files.
    When I run javac hello.java the file cannot be found. I've saved the file into my home folder inside a folder called test. Do I need to create a path with javac to this folder? I will be saving all my .java/.class files there. How would I do this?

  2. #2
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,165
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Javac Issues

    Which file is not found. hello.java? What is the current directory when you start javac?
    Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.

  3. #3
    Join Date
    Jan 2014
    Beans
    6

    Re: Javac Issues

    hello.java is not found.

  4. #4
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,165
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Javac Issues

    So what is your current directory when you invoke javac and what are its contents?
    Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.

  5. #5
    Join Date
    Feb 2014
    Beans
    6

    Re: Javac Issues

    Make sure you navigate to the .java file when using javac in the command prompt! Use
    the keyword "cd" to navigate, for example if I would have the .java file in C:\Java\helloworld.java, I would open up cmd.exe and type "cd C:\Java", then type "javac helloworld.java"

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •