[newbie] Java programming question?

2003-08-19 Thread Patrick Coffey
Hi,
   I'm still relatively new to linux so I was hoping someone might know a 
quick answer to this question, when I try to run a very simple program I 
wrote it gives me the error:

Exception in thread main java.lang.NoClassDefFoundError: lab1/java

It didn't give me any errors when I compiled it, so I figure it must be 
something I'm doing wrong. Any thoughts?

_
bGet MSN 8/b and enjoy automatic e-mail virus protection.  
http://join.msn.com/?page=features/virus


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Java programming question?

2003-08-19 Thread Michael Lothian
I once got this error in windows when I didn't have my PATH set propperly

Some info here

http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/classpath.html

I remember in windows I had to set the CLASSPATH=.   That's a fullstop 
(period to americans I think)

Mike

Patrick Coffey wrote:

Hi,
   I'm still relatively new to linux so I was hoping someone might 
know a quick answer to this question, when I try to run a very simple 
program I wrote it gives me the error:

Exception in thread main java.lang.NoClassDefFoundError: lab1/java

It didn't give me any errors when I compiled it, so I figure it must 
be something I'm doing wrong. Any thoughts?

_
bGet MSN 8/b and enjoy automatic e-mail virus protection.  
http://join.msn.com/?page=features/virus



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
 



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] Java programming question?

2003-08-19 Thread Kevin J CItron





Mkae sure you set your CLASSPATH to the location of your java class that

contains a main. You can either set it in your shell. Or as an argument
to the java vm.

In other words. If I have a class defined as

class Foo {
 
 public static void main(String[] args){
   System.out.println("Hello World");
 }
};

I compile this class in directory /tmp

The result of the compilation would leave me with a file named
Foo.class in /tmp

To run this program from tmp I would do this:

java -cp. Foo

The output should be Hello World



Patrick Coffey wrote:
Hi, 
 I'm still relatively new to linux so I was hoping someone might know a
 quick answer to this question, when I try to run a very simple program I
 wrote it gives me the error: 
 
"Exception in thread "main" java.lang.NoClassDefFoundError: lab1/java" 
 
It didn't give me any errors when I compiled it, so I figure it must be  something
I'm doing wrong. Any thoughts? 
 
_ 
bGet MSN 8/b and enjoy automatic e-mail virus protection.
 http://join.msn.com/?page=features/virus 
 
 
  

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
  


-- 

Kevin J Citron
Sr. Object Imagineer
Optimized Objects, Inc.
EL Paso, Texas 79930
(915) 565-5777/566-2403