It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

NoClassDefFoundError - but class file is in that directory!

NoClassDefFoundError - but class file is in that directory!

Postby Tommy_Boy on Tue Apr 17, 2007 1:54 pm

I am running a program that I can compile. but when I try to run it I get the NoClassDefFoundError: "myclass"

The class that it compiles does show up in the same directory that I run my compiler in but I still get the error.

What should I try to do?
Tommy_Boy
 
Posts: 3
Joined: Tue Apr 17, 2007 1:49 pm
Location: Washington,DC

Postby ggomez on Tue Apr 17, 2007 2:18 pm

mmmm

some code please
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡

Postby Tommy_Boy on Tue Apr 17, 2007 2:23 pm

Of course. Another note, is that when I compile it, I am using javac -classpath "/location/of/my/jar/file.jar" makeVisible.java, because the class contains the method is inside of file.jar


public class makeVisible
{
public static void main (String [] args) throws Exception
{
DirectIO dio = new DirectIO("filename", "/file/directory", "fileid", "/");
dio.makeVisible();
System.out.println("File is visible.");
}
}
Tommy_Boy
 
Posts: 3
Joined: Tue Apr 17, 2007 1:49 pm
Location: Washington,DC

Postby ggomez on Tue Apr 17, 2007 8:06 pm

Maybe the program is not finding the correct class

you can extract the directory that is inside the jar archive, put it where your program is, import the directory so you can use the classes you want.

if this works maybe the parameters in the javac are wrong.
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡


Who is online

Users browsing this forum: No registered users and 1 guest