a little confused about packages...



I'm writing a program in an IDE (jbuilder 2005), but when I try to
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???

.



Relevant Pages

  • Re: Late Binding .....
    ... Public Class TestClass ... Public Sub HelloWorld() ... Compile this code and create Test.Dll ...
    (microsoft.public.dotnet.languages.vb)
  • Re: a little confused about packages...
    ... compile it I get errors about classes not being found. ... package TestPkg; ... public class TestClass { ...
    (comp.lang.java.help)
  • Re: a little confused about packages...
    ... compile it I get errors about classes not being found. ... package TestPkg; ... public class TestClass { ...
    (comp.lang.java.help)
  • Re: question on multidimensional array
    ... > other compile errors in addition to that.. ... > voor het frame ... > public class Speelveld ...
    (comp.lang.java.help)
  • Re: [OT] Win32 JNI Console Class [was: Re: Clear the Screen]
    ... I know from some experience with Linux, the native code you are making into ... So when you are making your shared library you need to compile it with the ... If the library is compiled without being position independent then when you ... >> public class Console ...
    (comp.lang.java)