tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Dai ...@ddai.net>
Subject Re: A little offbeat question
Date Thu, 16 Sep 2004 08:48:48 GMT
Yes. The current directory is not automatically included in the 
CLASSPATH if you don't explicitly add it.

On 9/16/2004 1:02 AM, John Najarian wrote:
> Thanks, the '-cp .' did it.  Something is definitely hosed up.
> I haven't installed anything so I'm thinking it may be a virus
> although I have scanned my PC with newest definitions.
> 
> I'm still going to look at the CLASSPATH env var.  Maybe I should
> add '.' to the CLASSPATH variable.
> 
> 
> 
> -----Original Message-----
> From: martin@naxos-software.de [mailto:martin@naxos-software.de] 
> Sent: Thursday, September 16, 2004 12:40 AM
> To: Tomcat Users List
> Subject: Re: RE: A little offbeat question
> 
> 
> But the exception says "NoClassDefFoundError: HelloWorld/class". So
> where does the /class come from?? In any case don't bother with
> classpath environment, but (with the class in your current directory)
> simply run 'java -cp . HelloWorld'. Would really surprise me if it
> didn't work.
> 
> John Najarian <j-najarian@earthlink.net> schrieb am 16.09.2004,
> 09:32:18:
>> That's what I did.  When I was first learning Java that 1 bit me.
>> 
>> -----Original Message-----
>> From: martin@naxos-software.de [mailto:martin@naxos-software.de] 
>> Sent: Thursday, September 16, 2004 12:24 AM
>> To: Tomcat Users List
>> Subject: Re: A little offbeat question
>> 
>> 
>> Try running 'java ... HelloWorld' instead of 'java ... HelloWorld.class'
>> :-)
>> 
>> Regards,
>> Martin
>> 
>> John Najarian  schrieb am 16.09.2004,
>> 09:00:52:
>> > I tried to run a program I thought would but it doesn't.
>> > 
>> > This is on a windows XP platform.
>> > 
>> > Everything compiled well but I get this error:
>> > 
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> HelloWorld/class
>> > 
>> >  
>> > 
>> > So I went back and tried a no brainer 'HelloWorld'  This is the code.
>> > 
>> > /**
>> > 
>> >  * The HelloWorld class implements an application that
>> > 
>> >  * displays "Hello World!" to the standard output.
>> > 
>> >  */
>> > 
>> > public class HelloWorld {
>> > 
>> >     public static void main(String[] args) {
>> > 
>> >         // Display "Hello World!"
>> > 
>> >         System.out.println("Hello World!");
>> > 
>> >     }
>> > 
>> > }
>> > 
>> >  
>> > 
>> > It compiles but I get the same error.
>> > 
>> > I check my environment variables and mine are
>> > 
>> > JAVA_HOME c:\j2sdk1.4.2_03
>> > 
>> > PATH
>> >
>>
> C:\Perl\bin\;C:\j2sdk1.4.2_03\bin\;C:\j2sdkee1.3.1\bin\;%SystemRoot%\system3
>> > 2;%SystemRoot%;%SystemRoot%\system32\WBEM
>> > 
>> >  
>> > 
>> > Any ideas?
>> > 
>> >  
>> > 
>> > Thanks in advance
>> -- 
>> Martin Schaefer
>> NAXOS Software Solutions GmbH i.G.
>> Herrenstr. 1
>> 69502 Hemsbach
>> Germany
>>  
>> Phone:+49 (0) 6201 49298-2
>> Mobile: +49 (0) 172 6269246
>> Fax: +49 (0) 6201 49298-1
>> Mail: martin.schaefer@naxos-software.de
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


-- 
Dennis Dai
ml@ddai.net

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message