i have a a file Fd.java in which i am trying to call constructor of another class TRrelatn and both the classes are kept in same folder but it is giving error as well as exception that is


:\Fd.java:368: cannot find symbol
symbol : class TRrelatn
location: class FrmAdd
new TRrelatn();
^
FrmAdd is class in fd.java

and the exception is
java.lang.NoClassDefFoundError: Fd
Caused by: java.lang.ClassNotFoundException: Fd
at java.net.URLClassLoader$1.run(URLClassLoader.java:220)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:208)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Error: Could not find the main class.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Process completed

FrmAdd is class in fd.java

Note the class name and file name should be the same
Ex: if class name is "ABCD" the file name should be "ABCD.java"

Correct these and try again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.