Getting error while running Java program


I use Atom as my primary editor for all kind of coding purposes. I’m new to programming. I’m learning Java from Codecademy. I know how to setup the environment for Java. I installed the script package to run my Java code. But I’m getting this error while running my code. Please help

Java path is setup to system environment variables.


javac is clearly being called successfully, so that’s not an issue. The issue is that whatever string is being fed to it is not pointing at the file. From what I can see, it feels like a current working directory mismatch. Are you able to run the C files correctly?

Try opening Atom with Java Codes as the target and see if that changes things when you try to run it.


Yes the Java code is running when I open Java Codes folder as my project folder in Atom. Thanks by the way!!:blush:


And one more thing as I am using Windows so I use gpp compiler package to run my C and C++ codes.


Here’s how script works: it detects the language you’re working with and sends a command-line instruction to run that file with whatever command it has stored for that language. It’s automated, so sometimes it’s not the smartest, but troubleshooting it just involves figuring out what command it’s sending out.