Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"File not found" for JAVA file with Package - Script #1283

Closed
cmdshorty opened this issue Mar 19, 2017 · 5 comments
Closed

"File not found" for JAVA file with Package - Script #1283

cmdshorty opened this issue Mar 19, 2017 · 5 comments

Comments

@cmdshorty
Copy link

I'm not sure why this is happening as I have the latest JDK installed and added the PATH in my Environment Variables. But this is the error I'm getting in Atom AND in my Command Prompt:

javac: file not found: Lab1Main.java
Usage: javac <options> <source files>
use -help for a list of possible options
[Finished in 0.386s]

JAVA is all extremely new to me (only 2 weeks into the college course I'm taking currently) so I'm at the very bottom of knowing what to do here. (Not to mention, I've barely used Atom.) Do I need to set a PATH variable within Atom as well? I would really like to use Atom over Netbeans as it seems very easy to get things done.

Here's a screen shot of my PATH variables.
capture

@GorvGoyl
Copy link

Even I got the same error. Seem like it's not getting the correct path of the java file. I'm opening from the atom icon.. could that be the cause?

[Command: cmd '/c javac -Xlint PalindromeExample.java && java PalindromeExample']
javac: file not found: PalindromeExample.java
Usage: javac <options> <source files>
use -help for a list of possible options
[Finished in 0.29s]

@stevenkuipers
Copy link

Could you check if there are any spaces in the directory names and/or filenames? You can check this by running the script and then showing the output in the new tab (see image below for icon).

screen shot 2018-04-08 at 12 35 01

On mac (where I'm working on, having files and directories with spaces in them is no problem) but earlier this week I assisted someone with the same error: "file not found" on windows. Renaming the folder that had a space in it was a quick fix and afterward, it worked just fine. Only problem is that I don't have windows machine available so I can't do any further testing.

@dariens
Copy link

dariens commented Aug 14, 2018

I was able to get rid of this error by changing the 'Default Current Working Director (CWD) Behavior' to 'Directory of the script', in the 'script' Settings.

  1. Open Setting w/ in Atom (File>Settings)
  2. Click the 'Packages' tab w/ in Settings
  3. Search/Navigate to the 'script' package and click the 'Settings' tab.
  4. Change the 'Default Current Working Directory (CWD) Behavior' to 'Directory of the script'

PS:
The line "javac: file not found: Lab1Main.java" is an error code produced by javac. This means that indeed javac was called and hence the error was not due to your path variables. The fact that javac cant find the file you are trying to run means that something is wrong with the <source files> argument provided to the javac command.

@davidballad
Copy link

Could you check if there are any spaces in the directory names and/or filenames? You can check this by running the script and then showing the output in the new tab (see image below for icon).

screen shot 2018-04-08 at 12 35 01

On mac (where I'm working on, having files and directories with spaces in them is no problem) but earlier this week I assisted someone with the same error: "file not found" on windows. Renaming the folder that had a space in it was a quick fix and afterward, it worked just fine. Only problem is that I don't have windows machine available so I can't do any further testing.

do you know how to get rid of the spaces?

@aminya
Copy link
Member

aminya commented May 12, 2021

Should be fixed in #2470. Let me know if it is not.

@aminya aminya closed this as completed May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants