A. Cook A. Cook -4 years ago 143
Java Question

Problems running Java from Atom

I currently don't have a working way to edit and run Java on my computer, so I'm trying to get Atom working with Java (I realize it's not a Java IDE and I'm not trying to make it one, I just want to be able to do some light Java work on my laptop). I've installed the script and instant-build packages for Atom and wrote the following test code in a file called "main.java' in my project folder:

class Main{
public static void main(String[] args) {

When I try to run the code with cmd+i (I'm on a 2012 MacBook Pro) and get the following error message:Error: Could not find or load main class main.

I'd be happy to provide any further information; thanks for helping!

Answer Source

You have to name your file with the first letter in upper case Main.java, since it must match the name of your class

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download