Basic Help


#1

Hi! So this is probably a very basic question, but I’m having a little trouble saving my flies like I would like them to.

I’ve written a very basic programme to just print out a line of text, as I am just trying to get familiar with java programming. I am working off a mac, using atom as the place to write the code and then the default Terminal on my mac, to compile the code and also execute it.
When I was saving my code, I typed its name followed by .java this save it as Java source on my mac. When I try to compile it using javac Myclass.java, it tells me that no file is found.
Is that because I am saving my code as Java source, and if so how do I save it as java? Or is there and even simpler solution that I’m missing?

Thanks for any help…


#2

Mind sharing screenshots of your Atom and Terminal windows as you save and try to run the file?


#3

Hi! Thanks for your reply.

Here is the screenshot:


#4

You need to navigate to the folder you want to work from. The terminal is currently in your home folder, but you have saved the file somewhere in a folder called Codes. That’s why it can’t find the file.


#5

Ah, thank you. I read through the link and I finally got it to work, thanks so much!