mounting a jar archive

Discussion in 'Java' started by Luca Ferrari, May 10, 2004.

  1. Luca Ferrari

    Luca Ferrari Guest

    Hi all,
    I've developed two classes (package1.class1 and
    package1.subpackage.class2), compiled and put into a jar from the
    command line (jar cvf package1.jar package1/). Now, using netbeans, I
    can mount the jar seeing the code completion working fine, but when I
    try to compile I get an error like: class class2 is public and should be
    declared in a file named class2.
    Classes are ok (public and declared in rightly named files), so I cannot
    guess what is wrong.
    Any idea?

    Luca


    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
    Luca Ferrari, May 10, 2004
    #1
    1. Advertising

  2. Luca Ferrari

    Andy Fish Guest

    I've had this problem and I'm not sure exactly what caused it, but I think
    it's related to having the source files and the jar file mounted at the same
    time.

    if you want to treat your jar file as an external component, unmount the
    source directory; if you want the source to be part of your project, unmount
    the JAR file.

    maybe there is a way to do both (or maybe this is not exactly the problem)
    but that's what worked for me.

    "Luca Ferrari" <> wrote in message
    news:...
    > Hi all,
    > I've developed two classes (package1.class1 and
    > package1.subpackage.class2), compiled and put into a jar from the
    > command line (jar cvf package1.jar package1/). Now, using netbeans, I
    > can mount the jar seeing the code completion working fine, but when I
    > try to compile I get an error like: class class2 is public and should be
    > declared in a file named class2.
    > Classes are ok (public and declared in rightly named files), so I cannot
    > guess what is wrong.
    > Any idea?
    >
    > Luca
    >
    >
    > --
    > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
    Andy Fish, May 10, 2004
    #2
    1. Advertising

  3. Luca Ferrari

    Luca Ferrari Guest

    "Andy Fish" <> wrote in message
    news:mgMnc.7479$

    > I've had this problem and I'm not sure exactly what caused it, but I think
    > it's related to having the source files and the jar file mounted at the same
    > time.
    >
    > if you want to treat your jar file as an external component, unmount the
    > source directory; if you want the source to be part of your project, unmount
    > the JAR file.
    >
    > maybe there is a way to do both (or maybe this is not exactly the problem)
    > but that's what worked for me.

     

    I've tried to exclude the source when mounting the jar, but the problem
    remains!
    Any other idea?


    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
    Luca Ferrari, May 11, 2004
    #3
  4. Luca Ferrari

    Andy Fish Guest

    "Luca Ferrari" <> wrote in message
    news:...
    > "Andy Fish" <> wrote in message
    > news:mgMnc.7479$
    >
    > > I've had this problem and I'm not sure exactly what caused it, but I

    think
    > > it's related to having the source files and the jar file mounted at the

    same
    > > time.
    > >
    > > if you want to treat your jar file as an external component, unmount the
    > > source directory; if you want the source to be part of your project,

    unmount
    > > the JAR file.
    > >
    > > maybe there is a way to do both (or maybe this is not exactly the

    problem)
    > > but that's what worked for me.

    >
    >
    > I've tried to exclude the source when mounting the jar, but the problem
    > remains!
    > Any other idea?
    >


    hmm, make sure the jar file contains only the class files and not the
    source.

    Or you could fiddle around with the filesystem properties (use for compile,
    use for debug etc) but I don't think that was what made any difference for
    me.


    >
    > --
    > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
    Andy Fish, May 11, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe
    Replies:
    2
    Views:
    290
    Bob Ippolito
    Mar 3, 2004
  2. Dan Stromberg

    mounting a filesystem?

    Dan Stromberg, Feb 3, 2005, in forum: Python
    Replies:
    2
    Views:
    332
    Georg Brandl
    Feb 5, 2005
  3. Marcpp

    Mounting shares with python

    Marcpp, Jan 26, 2007, in forum: Python
    Replies:
    5
    Views:
    362
  4. paras sharma

    how to use mount() system call for cd image mounting

    paras sharma, Oct 7, 2007, in forum: C Programming
    Replies:
    3
    Views:
    496
    Tor Rustad
    Oct 8, 2007
  5. acn242
    Replies:
    0
    Views:
    368
    acn242
    Jun 10, 2008
Loading...

Share This Page