Home > Archive > Java Help > February 2006 > Any updates that might cause problems for SDK standard 1.3.1?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Any updates that might cause problems for SDK standard 1.3.1?
|
|
|
| I am trying to learn Java. I have a book that installs Version 1.3.1 of the
Java standard SDK. I could swear a few months ago it ran fine on my
computer, but now I keep getting an error message even though I am trying to
run a demo program. They seem to compile fine, but I get a "Exception in
thread "main" java.lang.NoClassDefFoundError. I have checked the Path
variables and they seem to be fine.
Anyone know of an update that might be causing problems for this version of
the SDK?
Thanks,
Clark
| |
| ge0rge 2006-02-25, 6:59 pm |
| Clark wrote:
> I am trying to learn Java. I have a book that installs Version 1.3.1 of the
> Java standard SDK. I could swear a few months ago it ran fine on my
> computer, but now I keep getting an error message even though I am trying to
> run a demo program. They seem to compile fine, but I get a "Exception in
> thread "main" java.lang.NoClassDefFoundError. I have checked the Path
> variables and they seem to be fine.
>
> Anyone know of an update that might be causing problems for this version of
> the SDK?
nowt to do with the update or the path.
Problem is classpath ... cos the java is not finding the class you are trying
to run.
If you are more specific about where you source is, how it is compiled, how you
are invoking it and also if there are package statement in your source code or
whether you have the classpath environment variable set (or not), someone here
will be able to tell you what's wrong.
--
A kiss is a course of procedure, cunningly devised, for the mutual
stoppage of speech at a moment when words are superfluous.
| |
|
| The file j2sdk-1_3_1-win.exe installed the software to my C:\jdk1.3.1
folder, with the bin folder in that. Running WixXP Pro.
I have set both Path and ClassPath to C:\jdk1.3.1\bin. I followed the
instructions in the book for a new install but when I try to run a program,
I get the error but it seems to compile fine.
This install worked fine on another computer a few months ago, but now does
the same thing as the new install. I can only assume an update to the SDK
or Java is causing the problem. Installed Java is 1.5.0 it appears.
I have just downloaded the SDK version 1.4.2 and if I can't get the older
version working, I will try to install the new one.
Clark
"ge0rge" <ge0rge@privacy.net> wrote in message
news:46brumF97l9mU1@individual.net...
> Clark wrote:
>
> nowt to do with the update or the path.
> Problem is classpath ... cos the java is not finding the class you are
> trying to run.
> If you are more specific about where you source is, how it is compiled,
> how you are invoking it and also if there are package statement in your
> source code or whether you have the classpath environment variable set (or
> not), someone here will be able to tell you what's wrong.
>
> --
> A kiss is a course of procedure, cunningly devised, for the mutual
> stoppage of speech at a moment when words are superfluous.
| |
| ge0rge 2006-02-25, 6:59 pm |
| Clark wrote:
> The file j2sdk-1_3_1-win.exe installed the software to my C:\jdk1.3.1
> folder, with the bin folder in that. Running WixXP Pro.
>
> I have set both Path and ClassPath to C:\jdk1.3.1\bin. I followed the
> instructions in the book for a new install but when I try to run a program,
> I get the error but it seems to compile fine.
>
> This install worked fine on another computer a few months ago, but now does
> the same thing as the new install. I can only assume an update to the SDK
> or Java is causing the problem. Installed Java is 1.5.0 it appears.
>
> I have just downloaded the SDK version 1.4.2 and if I can't get the older
> version working, I will try to install the new one.
OK. Looks to me that you have 3 versions of the JDK 1.3, 1,4 and 1.5.
First get rid of the classpath altogether.
open a prompt windown and type
java -version
At least you can confirm which version you are running (this should correspond
to the java bin directory you set up in the PATH environment variable).
Next go to the directory/folder where you have your java demo program
javac MyDemoProgram.java
java MyDemoProgram
If it does not work, show us the first few lines of your demo source program so
we can see the package declaration (if any) and also the name of the demo class
- which must correspond to the MyDemoProgram.java.
--
There are certain things men must do to remain men.
-- Kirk, "The Ultimate Computer", stardate 4929.4
| |
|
| Java shows as version 1.5.0_06
The book says if ClassPath is used by something else, I need to just add ;.
to it. Currently it is used by Quicktime as "C:\Program
Files\QuickTime\QTSystem\QTJava.zip"
If I don't need it for Quicktime, I will remove it.
The entire error message says this "Exception in thread "main"
java.lang.NoClassDefFoundError: HelloWorld"
This is the demo program and I compiled it and used the pre-compiled one
with same result. It did run before, but not now. Every program I try to
run does the same thing.
/*
* Hello World
* The classic first program
*/
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello, world!");
}
}
"ge0rge" <ge0rge@privacy.net> wrote in message
news:46bv8rFadtaiU1@individual.net...
> Clark wrote:
>
> OK. Looks to me that you have 3 versions of the JDK 1.3, 1,4 and 1.5.
> First get rid of the classpath altogether.
> open a prompt windown and type
> java -version
> At least you can confirm which version you are running (this should
> correspond to the java bin directory you set up in the PATH environment
> variable).
> Next go to the directory/folder where you have your java demo program
> javac MyDemoProgram.java
> java MyDemoProgram
>
> If it does not work, show us the first few lines of your demo source
> program so we can see the package declaration (if any) and also the name
> of the demo class - which must correspond to the MyDemoProgram.java.
>
> --
> There are certain things men must do to remain men.
> -- Kirk, "The Ultimate Computer", stardate 4929.4
| |
| ge0rge 2006-02-25, 6:59 pm |
| Clark wrote:
> Java shows as version 1.5.0_06
>
> The book says if ClassPath is used by something else, I need to just add ;.
> to it. Currently it is used by Quicktime as "C:\Program
> Files\QuickTime\QTSystem\QTJava.zip"
>
> If I don't need it for Quicktime, I will remove it.
OK. If you must have classpath, it should be
C:\Program Files\QuickTime\QTSystem\QTJava.zip;.
or
..;C:\Program Files\QuickTime\QTSystem\QTJava.zip
> The entire error message says this "Exception in thread "main"
> java.lang.NoClassDefFoundError: HelloWorld"
Assuming HelloWorld.java is in c:\myjava
cd to myjava then as I said before
javac HelloWorld.java
java HelloWorld
It should work ... it's gotta work!
--
Nothing succeeds like the appearance of success.
-- Christopher Lascl
| |
|
| I just got one to work. It was either the classpath or I moved the folder
with the programs up one level above the folder holding the sdk install. I
will continue to play to see if I can nail it down exactly.
Thanks for your help,
Clark
"ge0rge" <ge0rge@privacy.net> wrote in message
news:46c2kgF9j8j1U1@individual.net...
> Clark wrote:
>
>
> OK. If you must have classpath, it should be
> C:\Program Files\QuickTime\QTSystem\QTJava.zip;.
> or
> .;C:\Program Files\QuickTime\QTSystem\QTJava.zip
>
>
> Assuming HelloWorld.java is in c:\myjava
> cd to myjava then as I said before
>
> javac HelloWorld.java
> java HelloWorld
>
> It should work ... it's gotta work!
>
> --
> Nothing succeeds like the appearance of success.
> -- Christopher Lascl
| |
| Roedy Green 2006-02-25, 6:59 pm |
| On Sat, 25 Feb 2006 19:41:27 GMT, "Clark" <who@whoknows.com> wrote,
quoted or indirectly quoted someone who said :
>NoClassDefFoundError
see http://mindprod.com/jgloss/caq.html
If you are masochist, install an old version of Java on top a new. For
the rest of us, if you want to go back, uninstall the new Java first.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
| |
| ge0rge 2006-02-25, 6:59 pm |
| Clark wrote:
> I just got one to work. It was either the classpath or I moved the folder
> with the programs up one level above the folder holding the sdk install. I
> will continue to play to see if I can nail it down exactly.
>
> Thanks for your help,
You are welcome. Just a note to say that once you have set up the path (and
classpath which is more tricky - hence better not to have it at all), it is the
structure of your directories (not the SDK location) and the package statement
in your program which are the important factors.
--
In a museum in Havana, there are two skulls of Christopher Columbus,
"one when he was a boy and one when he was a man."
-- Mark Twain
|
|
|
|
|