Your question is not clear but I will try to respond anyway.
First create a file HelloWorld.java
:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
And put this file in the folder where you want to compile. Let's assume that this folder is C:\projetos\helloworld
.
Then, at the command prompt, while in the C:\projetos\helloworld
folder, you type the following command:
javac HelloWorld.java
And then the HelloWorld.class
file should have appeared in the folder. Now you type the following command:
java HelloWorld
And then Hello World
should be printed on the console.
If this does not work, tell what happened unexpected and what the error message was, if any. If it works, try doing the same with the program you want to compile.