Re: a little confused about packages...



jon23d@xxxxxxxxx wrote:
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???

Hi,

What do you type to run it?

cheers,

//mikael
.



Relevant Pages

  • Re: Dynamic Plug-in Loading with Ada
    ... Ada under GNAT/Linux. ... The package implemented procedures to run statements, ... compile subprograms and to compile packages. ... unsuited to Live Coding, but it *can* be made to work. ...
    (comp.lang.ada)
  • Re: Modelsim : Problem with generics
    ... definition in that package. ... Entities in a file with there architecture, testbench in an other with ... tried a lot of things and the "compile all" was part of it. ... But what I saw is it seems that the testbench does not recompile ...
    (comp.lang.vhdl)
  • Re: Use of libraries
    ... the entity will also contain the package that defines its interface ... 'Compile out of date' from the GUI and go right on back to simulating. ... vcom -just p *.vhd ...
    (comp.lang.vhdl)
  • Re: DebToo: Debian, Gentoo-style
    ... I just have one question for all you folks who like to compile every ... review had Debian on top, Debian was only compiled with I386. ... Also Isn't Gentoo starting to introduce binaries of packages to ease ... I wonder how the package manager keeps up with the ...
    (Debian-User)
  • Re: How do I install this missing library?
    ... How does that answer the question "What are you trying to compile? ... >> I even TOLD you what to google for! ... You don't care WHAT the ... Your package manager will tell you all you need to know. ...
    (comp.os.linux.misc)