Exception in thread "main" java.lang.NoClassDefFoundError: H
Caused by: java.lang.ClassNotFoundException: H
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: H. Program will exit.

should I need to declare stuff like system variables or anything that is necessary to setup first

Exception in thread "main" java.lang.NoClassDefFoundError: H
Caused by: java.lang.ClassNotFoundException: H
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: H. Program will exit.

Exception in thread "main" java.lang.NoClassDefFoundError: H
Caused by: java.lang.ClassNotFoundException: H
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: H. Program will exit.

When you do an 'ls' (or 'dir' depending on your OS) in the directory where your H.java file is stored, can you see an H.class file? Is that directory writable to you?