noclassdeffounderror help needed

Y

yamini

Hi all,

I have a program test.java as follows,

class test
{
public static void main(String args[])
{
System.out.println("welcome");
}
}

I complied it using javac test.java.
My program complied successfully. then when i tried to run it using
java test, I got an error "java.lang.noclassdeffounderror".Can anyone
suggest me of how to solve it.

With smiles,
Deepa.
 
K

klynn47

My guess is that it has something to do with your CLASSPATH. Make sure
if you have a CLASSPATH set that you have . in it.
 
G

gautambhatt

yamini said:
Hi all,

I have a program test.java as follows,

class test
{
public static void main(String args[])
{
System.out.println("welcome");
}
}

I complied it using javac test.java.
My program complied successfully. then when i tried to run it using
java test, I got an error "java.lang.noclassdeffounderror".Can anyone
suggest me of how to solve it.

With smiles,
Deepa.

It appears that u have not set the Classpath variable properly

if u are using Win2k . . . . u can set an env variable 'classpath' and
set the path of the folder where u are executing the java command for
running the file

say folder name is 'c:\java' , then classpath variable shud have the
same path in it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top