I can't get my java programs to run. For example I will go and type out the code in textpad and save as "Test.java". The syntax highlighting pops up and all appears good. I then compile and that gives me no errors. I then run and I get >>Exception in thread "main" java.lang.NoClassDefFoundError: Test<<. I get the same results using dos, but JBuilder strangly enough compiles and runs. The preceding error I recognize usually pops if the class name doesn't match the file name or the file name extension isn't exact. I checked mycomputer and it seems to have saved my files as Test~1.jav and Test~1.cla. I assume that java.exe and javac.exe will choke on those extensions, but then again Test compiled with no promblems (dos compile works too). Are the extenstions the promblem and is there a way to fix them.
If it matters my OS is win98 and java is jdk1.2.1. This computer also has installed JBuilder and J++ (if that might cause complications?). On my second computer (win98se) everything works fine.
I get .jav and .cla when I really want .java and .class. Ho
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: I get .jav and .cla when I really want .java and .class.
in your dos box, go to the directory which contains your java and class files.
type
dir /x
you should now see the dos-names (8.3) and the full names of the files.
Check whether the full names are correct or not and report back here.
Andreas
type
dir /x
you should now see the dos-names (8.3) and the full names of the files.
Check whether the full names are correct or not and report back here.
Andreas
Re: I get .jav and .cla when I really want .java and .class.
Dos didn't recognize the /x and I couldn't find /x with dir /?. Just using the regular dir command to veiw the files; however, the files were in 8.3 format and not as they should be.
Re: I get .jav and .cla when I really want .java and .class.
Oooops, missed the Win98 bit - I think the /x is available only in WinNT Dos box.
What happens if you run
type xxx.java
(where xxx.java stands for one of your existing .java files)
Andreas
What happens if you run
type xxx.java
(where xxx.java stands for one of your existing .java files)
Andreas
Re: I get .jav and .cla when I really want .java and .class.
If I run java compile in dos it gives me no errors. Same with textpad's javac compile. But then I can't get a successfull run on the resulting class with neither textpad nor the dos prompt.
While dos and myComputer both show my files as Test~1.jav and Test~1.cla, when I type dir Test.class in dos that gives me Test~1.cla which seem that dos does recognize the file, dir Test.clas however doesn't work. So Test.class exist I just can't see it. Also on my computer that works with textpad the file are also 8.3 format, so I'm not sure if they are the promblem anymore that causing the exception in thread main no class Test found error.
I tried to reinstall the program this morning and that didn't fix the promblem. I also importing the regrestry setting from the computer that did have it working, but that didn't help either.
While dos and myComputer both show my files as Test~1.jav and Test~1.cla, when I type dir Test.class in dos that gives me Test~1.cla which seem that dos does recognize the file, dir Test.clas however doesn't work. So Test.class exist I just can't see it. Also on my computer that works with textpad the file are also 8.3 format, so I'm not sure if they are the promblem anymore that causing the exception in thread main no class Test found error.
I tried to reinstall the program this morning and that didn't fix the promblem. I also importing the regrestry setting from the computer that did have it working, but that didn't help either.
Re: I get .jav and .cla when I really want .java and .class.
Hi, I've just started doing some Java development and am experiencing the same problem. I can run my Java classes fine when they're created in and run from TextPad, but when I go to my Win '95 DOS window, the names are mangled--even a short one like 'abc.java' becomes 'abc~1.jav'. I'll try again at home on my NT machine.
The reason I was trying to run the programs in a DOS window to begin with was to be able to add some command line arguments--is there a way to do that in TextPad? If so, that would solve my problem as well.
thanks,
Mark Turnbull / Mark@Contented.com
The reason I was trying to run the programs in a DOS window to begin with was to be able to add some command line arguments--is there a way to do that in TextPad? If so, that would solve my problem as well.
thanks,
Mark Turnbull / Mark@Contented.com
Re: I get .jav and .cla when I really want .java and .class.
The "mangling" will occur if either the name is longer than 8 or the extension is longer than 3!
Andreas
Andreas