Re: a little confused about packages...
- From: jon23d@xxxxxxxxx
- Date: 29 Jun 2006 01:43:16 -0700
javac TestPkg.java <--- this works fine
java TestPkg <---- this doesn't!
This is what I've used up until I started using packages, and has
worked fine...
Petterson Mikael wrote:
jon23d@xxxxxxxxx wrote:
I'm writing a program in an IDE (jbuilder 2005), but when I try toHi,
compile it I get errors about classes not being found. I figure out
that it has something to do with the package, so I test it out using a
smaller version.
Here is what my directory structure looks like:
~/devel/java/TestPkg/TestPkg.java
~/devel/java/TestPkg/TestClass.java
TestPkg.java is:
package TestPkg;
public class TestPkg {
public static void main(String[] args){
System.out.println("Test");
}
}
TestClass.java is:
package TestPkg;
public class TestClass {
TestClass() {
System.out.println("TestClass");
}
}
When I run the compiler everything is fine, but when I try to run it
everything goes nuts! If I remove the package declaration from the
beginning of TestPkg.java then everything works just fine. Is there
some key point I'm missing here???
What do you type to run it?
cheers,
//mikael
.
- Follow-Ups:
- Re: a little confused about packages...
- From: Oliver Wong
- Re: a little confused about packages...
- From: Bjorn Abelli
- Re: a little confused about packages...
- References:
- a little confused about packages...
- From: jon23d
- Re: a little confused about packages...
- From: Petterson Mikael
- a little confused about packages...
- Prev by Date: Re: Represent work in progress on std out
- Next by Date: Re: a little confused about packages...
- Previous by thread: Re: a little confused about packages...
- Next by thread: Re: a little confused about packages...
- Index(es):
Relevant Pages
|