[RESOLVED] Program compiled but does not run
CIAO
My programs are compiled but do not run for example if I write the program
class Abbas
{
public static void main(String args[])
{
System.out.println("Abbas Haider");
}
}
it is compiled using javac, it even catches the errors if I make some mistake in the syntax, but when it is compiled without errors it does not run. It gives me this message:
Exception in thread "main" java.lang.NoClassDefFoundError: Abbas
Plz solve this and thanks in advance
A. Haider
Re: Program compiled but does not run
Hi,
Have you set the path for the jdk compiler? When I started using java I got that error message..When I set the path, all my programs work fine..
If your operating system is windows xp/windows 2000 , go to control panel -> system ->advanced -> environment variables ->system variables
Look for the Path variable. Append this statement to your path value
where jdk1.5 is the directory of my jdk compiler. If you have set the path, you may restart your computer to effect the changes..
Greg :) :) :)
Re: Program compiled but does not run
Definitely a problem with environment variables.
Re: Program compiled but does not run
Problem still persist
I would like to mention one thing I am using jdk1.3
Also Applet files do not run but are compiled
Thanks
Re: Program compiled but does not run
Hi,
I guess theres something wrong with the compiler..Try downloading jdk1.5 or jdk1.4 from Sun Microsystems..Use them instead of jdk1.3...
Most of the java folks are not using jdk1.3..Another option is to try reinstalling the jdk1.3 compiler in your machine...Then repeat my instructions in post number 2...
Greg :) :) :)
Re: Program compiled but does not run
If the problem still persits then you still haven't set your enviroment variables correctly.
Re: Program compiled but does not run
As for the environmental variables I cannot figure out whats wrong. Should I have to install my OS again. I worked with the instructions u folks gave for environmental variables but it didnt worked out. I am thinking to reinstall my OS.
I m using win xp
Re: Program compiled but does not run
Quote:
Originally Posted by Abbas Haider
As for the environmental variables I cannot figure out whats wrong. Should I have to install my OS again. I worked with the instructions u folks gave for environmental variables but it didnt worked out. I am thinking to reinstall my OS.
I m using win xp
This won't solve anything
Re: Program compiled but does not run
Quote:
Originally Posted by Abbas Haider
As for the environmental variables I cannot figure out whats wrong. Should I have to install my OS again. I worked with the instructions u folks gave for environmental variables but it didnt worked out. I am thinking to reinstall my OS.
I m using win xp
What's your classpath look like? As CompJy said, reinstalling won't do anything...It will simply reset your variables and you'll have to set them again.
Re: Program compiled but does not run
How are you running the program? Do you have a CLASSPATH environment variable set? If so, what is its value?
Re: Program compiled but does not run
15 days just to get java to work!???
I wonder how long will it take to run Oracle
Re: Program compiled but does not run
Hahaha
ORACLE was not a problem even the java is not a problem at least I know I am compiling my programs correctly only I am unable to see the output I have worked on JAVA as well as ORACLE three yrs ago on other systems
its only my Machine that stinks
Re: Program compiled but does not run
I suggest you try an IDE to get your files running.
try NetBeans or Eclipse. Those are the good ones I know
Re: Program compiled but does not run
Re: Program compiled but does not run
Try those steps, it may solve your problem
1- Goto the "java control panel" in control panel
2- goto the "Java" tab"
3- click on "view" under "Java Application Runtime Settings"
4- make sure both user and system have values set and a vaild path.
if any of them doesn't, then Add one or find it
Re: Program compiled but does not run
run java as exe files.
This download is a very wonderful tool for all people who can compile java but can't get it to run properly
Re: Program compiled but does not run
You wont believe it, but MS J#.net is a cheat version of Java. My files of Java code are running fine in VS J#.net !!!!
Try it out
Thats solve my problem for now, I have not switched to Java Applets and JSP etc I wonder how can I tackle with them.........Maybe same trick
:D :D :D :D :D :D :D
Re: [RESOLVED] Program compiled but does not run
J# is an entirely different language than Java, even if it is aimed at compatibility. You definitely won't be able to run anything J#-compiled as an applet or JSP.