Hi, Im new in this forums looking for an answer for my problem, I find a similar post here so I decided to suscribe here because this website look very professional.

I had the following code:

public class Gen {

	public static void main(String[] args){
		args = new String[6];
		preLoad(args, null);

My error happens when I run my class file,

[root@localhost classes]# java Gen
Exception in thread "main" java.lang.NoClassDefFoundError: Gen
Caused by: java.lang.ClassNotFoundException: Gen
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: Gen.  Program will exit.

I dont know why, but I run the same file on a windows enviroment using JCreator and it runs perfectly, what should be wrong?

Have you compiled Gen.java yet with 'javac'?

yes ...hmm thankyou I found an alternative code javac -d $CLASSPATH Gen.java