Hello world is compile..but run time error has occured..i.e. expection in thread main:java.lang.NoDefFoundErrorplease send replay for this question.....

Showing Answers 1 - 2 of 2 Answers

Mukesh Bansal

  • Nov 3rd, 2005
 

Try this simple program:

class  Test
{
 public static void main(String[] args)
 {
  System.out.println("Hello World!");

 }
}

Dont forget to set the classpath as the current directory as mentioned below:

on windows:     set CLASSPATH=%CLASSPATH%;.

on Unix:      export CLASSPATH=$CLASSPATH:.

  Was this answer useful?  Yes

Devidas

  • Nov 28th, 2005
 

On window C://  copy con j.bat set classpath="C:/j2sdk1.4.2_04/bin"; "C:/jre1.4.2_04/bin" ; then press Ctrl+Z and enter. In this way we can set classpath. then try j is our batch file.

On Unix export CLASSPATH=$CLASSPATH:

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions