Class not found in compile by Windows CMD

1

I'm not able to run my algorithms in Java through the Windows 8.1 terminal.

It happens that always gives a class error not found, I already put the .class files together with .java and still can not find.

What do I do to resolve?

Here are some pictures to illustrate my doubt.

All files together in the same folder →

Runningthejavacsistema.javacommandintheCMD→

PS: I have already used the command javac sistema.java pessoa.java aluno.java and NOTHING.

    
asked by anonymous 25.09.2015 / 03:38

1 answer

1

To compile the classes you must save the class with the same name as you will use to call the class by cmd.

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}

You should call cmd this way:
javac HelloWorld .java

It is possible to name a class with any name supported by the language. But it is interesting to follow some rules adopted:

Each class must begin with a capital letter, if a class name consists of more than one word, the first letter of each word must be uppercase. Do not declare a class with any special characters (@, #, $,%, & amp ;, *, _, etc ...). The selected word should reflect the purpose of the class.

Always place the class in some package.

    
25.09.2015 / 13:41