I think I see a problem here ...
I don't know if your java works with cmd, but my explanation will assume you. Outside of using IDEs such as Netbeans and Eclipse, which greatly simplify the process of building Java code, it's good to know how this works.
Ok, here goes:
1) Java - (.class ), JAVAC
javac [optional flags] [path to file intended for compilation]
-, JVM .
2) Java- (JVM) -.
java [optional flags] [name of class file w/o .class extension]
, JVM main.java, , , .
, .
cd
, (src
)javac -cp . program/
(, , , GUI.class
)javac -cp . Main
java -cp . Main
. IDE , .