no applications  
Author Message
Pat Brady





PostPosted: 2004-5-30 6:25:00 Top

java-programmer, no applications hi guys

ive installed the jdk on my xp system
it will run applets, but when i try to run
an application i get the following
message in the command prompt window

'Exception in thread "main" java.lang.NoClassDefFoundError:'

the same programs work fine on the collage system, so
it shouldn't be the code

please help

pat


 
Andrew Thompson





PostPosted: 2004-5-30 6:32:00 Top

java-programmer >> no applications On Sat, 29 May 2004 23:24:33 +0100, Pat Brady wrote:

> 'Exception in thread "main" java.lang.NoClassDefFoundError:'

<http://mindprod.com/jgloss/errormessages.html#INDEX>

Though try..

C:/> java -classpath . TheClass

> the same programs work fine on the collage system,

It sounds like you will get a fragmentary education..
<http://www.google.com/search?q=define+collage>

;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Pat Brady





PostPosted: 2004-5-30 6:59:00 Top

java-programmer >> no applications thanks for the reply

cant find the error message on the mindprod site
and when i type C:/> java -classpath in the command
prompt window i get 'not recognised internal or external
command, operable program or batch file'

ive set my classpath to C:\jdk1.3\ as this is where the
jdk is located
do i need to do any more than that ?

if the problem is with the classpath, then why do the
applets work ?
is the classpath just for apps ?

fragmented education ?
fragmented brain methinks !

cheers

pat




"Andrew Thompson" <email***@***.com> wrote in message
news:email***@***.com...
> On Sat, 29 May 2004 23:24:33 +0100, Pat Brady wrote:
>
> > 'Exception in thread "main" java.lang.NoClassDefFoundError:'
>
> <http://mindprod.com/jgloss/errormessages.html#INDEX>
>
> Though try..
>
> C:/> java -classpath . TheClass
>
> > the same programs work fine on the collage system,
>
> It sounds like you will get a fragmentary education..
> <http://www.google.com/search?q=define+collage>
>
> ;-)
>
> --
> Andrew Thompson
> http://www.PhySci.org/ Open-source software suite
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.1point1C.org/ Science & Technology


 
 
Andrew Thompson





PostPosted: 2004-5-30 7:11:00 Top

java-programmer >> no applications On Sat, 29 May 2004 23:59:08 +0100, Pat Brady wrote:

> thanks for the reply

You are welcome, could I ask you not to
top-post? I get confused..
<http://www.physci.org/codes/javafaq.jsp#netiquette>

>> <http://mindprod.com/jgloss/errormessages.html#INDEX>
..
> cant find the error message on the mindprod site

Sorry, my bad.. try this more specific one..
<http://mindprod.com/jgloss/errormessages.html#NOCLASSDEFFOUNDERROR>

> and when i type C:/> java -classpath in the command
> prompt window i get 'not recognised internal or external
> command, operable program or batch file'

OoooK ..let me try a different way
to explain what I mean..
(cross your fingers, this is experimental..)
<http://www.physci.org/eg/dos.jsp?text=%0D%0AC%3A%5C%3Erem%3A+run+the+app%0D%0AC%3A%5C%3Ejava+PlafChanger%0D%0AException+in+thread+%22main%22+java.lang.NoClassDefFoundError%3A+PlafChanger%0D%0A%0D%0AC%3A%5C%3Erem%3A+add+the+current+directory+to+classpath..%0D%0AC%3A%5C%3Ejava+-classpath+.+PlafChanger%0D%0A%0D%0AOK%0D%0A%0D%0AC%3A%5C%3E%0D%0A>

HTH

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
 
Pat Brady





PostPosted: 2004-5-30 8:14:00 Top

java-programmer >> no applications
"Andrew Thompson" <email***@***.com> wrote in message
news:email***@***.com...
> On Sat, 29 May 2004 23:59:08 +0100, Pat Brady wrote:
>
> > thanks for the reply
>
> You are welcome, could I ask you not to
> top-post? I get confused..
> <http://www.physci.org/codes/javafaq.jsp#netiquette>
>
> >> <http://mindprod.com/jgloss/errormessages.html#INDEX>
> ..
> > cant find the error message on the mindprod site
>
> Sorry, my bad.. try this more specific one..
> <http://mindprod.com/jgloss/errormessages.html#NOCLASSDEFFOUNDERROR>
>
> > and when i type C:/> java -classpath in the command
> > prompt window i get 'not recognised internal or external
> > command, operable program or batch file'
>
> OoooK ..let me try a different way
> to explain what I mean..
> (cross your fingers, this is experimental..)
>
<http://www.physci.org/eg/dos.jsp?text=%0D%0AC%3A%5C%3Erem%3A+run+the+app%0D
%0AC%3A%5C%3Ejava+PlafChanger%0D%0AException+in+thread+%22main%22+java.lang.
NoClassDefFoundError%3A+PlafChanger%0D%0A%0D%0AC%3A%5C%3Erem%3A+add+the+curr
ent+directory+to+classpath..%0D%0AC%3A%5C%3Ejava+-classpath+.+PlafChanger%0D
%0A%0D%0AOK%0D%0A%0D%0AC%3A%5C%3E%0D%0A>
>
> HTH
>
> --
> Andrew Thompson
> http://www.PhySci.org/ Open-source software suite
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.1point1C.org/ Science & Technology


sorry

i hope this is what you mean by not top-posting

i dont run apps/applets from the cmd prompt, normally i click
tools - run app/applet in textpad, so this cmd prompt stuff is
a bit off the wall for me (please bear with me)

when i open the cmd prompt i get this:
C:\Documents and Settings\Pat Brady>
then i type:
C:\>java -classpath . BeerSong
and i get this reply
'C:\' is not recognized as an internal or external command, operable
program or batch file

in xp i go to
control panel - system - advanced - environment variables
and then set the CLASSPATH to
C:\jdk1.3\bin

is this right ?


i apologise for the patience required

pat


 
 
Ryan Stewart





PostPosted: 2004-5-30 9:32:00 Top

java-programmer >> no applications "Pat Brady" <email***@***.com> wrote in message
news:qH9uc.895$email***@***.com...
> sorry
>
> i hope this is what you mean by not top-posting
>
Quite right, yes. Thanks for the consideration.

> i dont run apps/applets from the cmd prompt, normally i click
> tools - run app/applet in textpad, so this cmd prompt stuff is
> a bit off the wall for me (please bear with me)
>
*nudges Andrew* Where are those anti-command-line junkies?

> when i open the cmd prompt i get this:
> C:\Documents and Settings\Pat Brady>
> then i type:
> C:\>java -classpath . BeerSong
> and i get this reply
> 'C:\' is not recognized as an internal or external command, operable
> program or batch file
>
Leave out the "C:\>". Just type "java -classpath . BeerSong".

> in xp i go to
> control panel - system - advanced - environment variables
> and then set the CLASSPATH to
> C:\jdk1.3\bin
>
> is this right ?
>
No. The classpath is where Java looks for class files, not where it looks
for java.exe. Hence setting the classpath to the current directory (via
"-classpath .") will usually solve your NoClassDefFoundErrors. If you don't
*need* the classpath for anything (you probably don't), you can just remove
the classpath environment variable, and it will default to the current
directory.

> i apologise for the patience required
>
No problem. We enjoy helping courteous people.


 
 
Andrew Thompson





PostPosted: 2004-5-30 12:41:00 Top

java-programmer >> no applications On Sat, 29 May 2004 20:31:49 -0500, Ryan Stewart wrote:

> "Pat Brady" <email***@***.com> wrote in message
...
>> i dont run apps/applets from the cmd prompt, normally i click
>> tools - run app/applet in textpad, so this cmd prompt stuff is
>> a bit off the wall for me (please bear with me)
>>
> *nudges Andrew* Where are those anti-command-line junkies?

(chuckles) They vanish quickly at times like this!
...
> No. The classpath is where Java looks for class files, not where it looks
> for java.exe. Hence setting the classpath to the current directory (via
> "-classpath .") will usually solve your NoClassDefFoundErrors. If you don't
> *need* the classpath for anything (you probably don't), you can just remove
> the classpath environment variable, and it will default to the current
> directory.

Something I did not make clear. That idea of adding
the current directory to the class path only works when
you are 'inside' the directory with the .class file.

If you're .java and .class is located..

C:\javatest\projectA\> dir
TestRun.java
TextRun.class

..then you need to put a .bat file in the directory..

'runTheProject.bat' containing the single line..

java -cp . TestRun

So your directory may now look like..

C:\javatest\projectA\> dir
TestRun.java
TextRun.class
runTheProject.bat

If you double click 'runTheProject.bat'
the diectory 'C:\javatest\projectA\'
will be added to the classpath and
'C:\javatest\projectA\TestRun.class'
will be visible to Java..

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
 
Pat Brady





PostPosted: 2004-5-31 2:26:00 Top

java-programmer >> no applications
"Andrew Thompson" <email***@***.com> wrote in message
news:email***@***.com...
> On Sat, 29 May 2004 20:31:49 -0500, Ryan Stewart wrote:
>
> > "Pat Brady" <email***@***.com> wrote in message
> ...
> >> i dont run apps/applets from the cmd prompt, normally i click
> >> tools - run app/applet in textpad, so this cmd prompt stuff is
> >> a bit off the wall for me (please bear with me)
> >>
> > *nudges Andrew* Where are those anti-command-line junkies?
>
> (chuckles) They vanish quickly at times like this!
> ...
> > No. The classpath is where Java looks for class files, not where it
looks
> > for java.exe. Hence setting the classpath to the current directory (via
> > "-classpath .") will usually solve your NoClassDefFoundErrors. If you
don't
> > *need* the classpath for anything (you probably don't), you can just
remove
> > the classpath environment variable, and it will default to the current
> > directory.
>
> Something I did not make clear. That idea of adding
> the current directory to the class path only works when
> you are 'inside' the directory with the .class file.
>
> If you're .java and .class is located..
>
> C:\javatest\projectA\> dir
> TestRun.java
> TextRun.class
>
> ..then you need to put a .bat file in the directory..
>
> 'runTheProject.bat' containing the single line..
>
> java -cp . TestRun
>
> So your directory may now look like..
>
> C:\javatest\projectA\> dir
> TestRun.java
> TextRun.class
> runTheProject.bat
>
> If you double click 'runTheProject.bat'
> the diectory 'C:\javatest\projectA\'
> will be added to the classpath and
> 'C:\javatest\projectA\TestRun.class'
> will be visible to Java..
>
> --
> Andrew Thompson
> http://www.PhySci.org/ Open-source software suite
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.1point1C.org/ Science & Technology


doods

ive no idea what yer on about

however
ive uninstalled all the java stuff
then installed it all again

and for sure it all works
(i.e. compile/run from textpad)

im not certain about the cmd prompt stuff
so i think i'll leave it for now
is it that necessary ?
are there any good books/sites explaining
about it ?
ive got 'HeadFirstJava' and Deitel 'How to ...'
but both of these seem to expect you to know this
stuff

i guess its 'Command Prompt for Dummies' for me !

this is my first time using a newsgroup and i have to
say the vibe is excellent

Andrew, ive made a small (i am a student) donation
to your site
keep up the good work

thanks a mill

pat


 
 
Andrew Thompson





PostPosted: 2004-5-31 12:53:00 Top

java-programmer >> no applications On Sun, 30 May 2004 19:25:37 +0100, Pat Brady wrote:
> "Andrew Thompson" <email***@***.com> wrote in message
>> On Sat, 29 May 2004 20:31:49 -0500, Ryan Stewart wrote:
>>> "Pat Brady" <email***@***.com> wrote in message
...
> im not certain about the cmd prompt stuff
> so i think i'll leave it for now
> is it that necessary ?

Depends who you ask.. We all are constantly
discussing (OK ..bickering) about it.

> are there any good books/sites explaining
> about it ?

I am not so familiar with the specifics of
books good for teaching this sort of beginner
detail. Books usually either ignore the
comand line (DOS) or mention it in passing,
assuming the student has had to get a handle
on it previously.

> ive got 'HeadFirstJava' and Deitel 'How to ...'
> but both of these seem to expect you to know this
> stuff

Ahhh.. yup.

> i guess its 'Command Prompt for Dummies' for me !

I have been thinking of doing more pages on
the command line. How to ..copy text out of it,
send O/P to a file, build long commands with
variables, ..etc.

> this is my first time using a newsgroup and i have to
> say the vibe is excellent

It is a nice community here..

> Andrew, ive made a small (i am a student) donation
> to your site

Yes, I was surprised and delighted to
see the notification in my mail-box
earlier.

It is worth a million to me Pat..

> keep up the good work
>
> thanks a mill

Thank You! I have had that button on my
site for some months and you are the *first*
to actually make a donation.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology