Newbie with NetBeans and .JAR files...

Discussion in 'Java' started by Leonard Slatkin, Nov 15, 2003.

  1. I'm taking my first Java course, and we're using the NetBeans IDE.

    I'm trying to use .JAR files:

    For example, I have a package (all in a folder with the same name) that
    compiles and executes fine. I make a JAR out of it using NetBeans, and
    mount TestJar.jar with File> Mount Filesystem> Archive files.
    The package seems to mount just fine: I can open the source files I
    included (they are read-only), and all the .class files are there, but
    when I try to execute the main class

    FireSupport/MyMainClass.java [0:0] No file named
    FireSupport/MyMainClass.java exists on disk in TestJar.jar.
    Therefore it may not be compiled with an external compiler.
    You may need to check it out from version control or save some changes
    to it.
    Errors compiling MyMainClass.

    What am I doing wrong?

    Thanks for any help!



    This is how I make the JAR file:
    File> New > JAR Archives > JAR Recipe and:
    enter TestJar as the name,
    select All Files in the Recipe Filter,
    and ADD the folder that contains all my files in the package
    I click "Generate" on the JAR Manifest page, add the line:
    Main-Class: MyMainClassName
    and click Finish.

    Then, I right-click on the new TestJar file in the Explorer
    [Filesystems], and choose Compile.

    A file called TestJar.jar is created, and if I unzip it, everything
    looks okay inside.
     
    Leonard Slatkin, Nov 15, 2003
    #1
    1. Advertising

  2. "Leonard Slatkin" <> wrote in message
    news:151120031448100842%...
    >
    > I'm taking my first Java course, and we're using the NetBeans IDE.


    Your instructor is an idiot if they specified you
    use NetBeans to learn Java - use the command line.

    > I'm trying to use .JAR files:


    I do not have the time to figure out why a newbie
    making jar's using an advanced IDE does not work.

    (Though, wild guess, it might be a missing manifest file)

    If you dump the IDE and check out the sun tutorials,
    you are probably going to get much more help here..

    HTH

    --
    Andrew Thompson
    http://www.AThompson.info/
    http://www.PhySci.org/
    http://www.1point1C.org/
     
    Andrew Thompson, Nov 16, 2003
    #2
    1. Advertising

  3. Leonard Slatkin

    Sudsy Guest

    Andrew Thompson wrote:

    > "Leonard Slatkin" <> wrote in message
    > news:151120031448100842%...
    >
    >>I'm taking my first Java course, and we're using the NetBeans IDE.
    >>

    >
    > Your instructor is an idiot if they specified you
    > use NetBeans to learn Java - use the command line.



    Geez, Andrew! Cut the kid some slack!
    I've been playing around with Eclipse for the last few days and it
    does some things quite well. It's still fragile so you have to make
    regular backups of your workspaces and it can be obstructive when
    writing code "heads-down" but it does have its place.
    I find that it works best for me when I write the code using vi,
    import into a project and then use the "Organize imports" function
    and the XDoclet processing to generate all the extra files (home
    and remote interfaces, deployment descriptors, etc.). Boilerplate
    the XDoclet and packaging XML files and you can actually save some
    time.
    YMMV
     
    Sudsy, Nov 16, 2003
    #3
  4. In article <Pjztb.12447$>, Andrew
    Thompson <> wrote:

    > "Leonard Slatkin" <> wrote in message
    > news:151120031448100842%...
    > >
    > > I'm taking my first Java course, and we're using the NetBeans IDE.

    >
    > Your instructor is an idiot if they specified you
    > use NetBeans to learn Java - use the command line.
    >
    > > I'm trying to use .JAR files:

    >
    > I do not have the time to figure out why a newbie
    > making jar's using an advanced IDE does not work.
    >
    > (Though, wild guess, it might be a missing manifest file)
    >
    > If you dump the IDE and check out the sun tutorials,
    > you are probably going to get much more help here..
    >
    > HTH
    >
    > --
    > Andrew Thompson
    > http://www.AThompson.info/
    > http://www.PhySci.org/
    > http://www.1point1C.org/
    >
    >


    Wow, that was very helpful, thank you! Hope it was worth your valuable
    time.
     
    Leonard Slatkin, Nov 16, 2003
    #4
  5. "Sudsy" <> wrote in message
    news:...
    > Andrew Thompson wrote:
    > > "Leonard Slatkin" <> wrote in message
    > > news:151120031448100842%...
    > >>I'm taking my first Java course, and we're using the NetBeans IDE.

    > >
    > > Your instructor is an idiot if they specified you
    > > use NetBeans to learn Java - use the command line.

    >
    > Geez, Andrew! Cut the kid some slack!


    It is not 'the kid' with whom I have a problem,
    it is the instructor who does not start his/her
    students developing 'hello world' apps for
    the command line.

    > I've been playing around with Eclipse for the last few days and it
    > does some things quite well.


    I use Eclipse also, it is great.
    I also use Textpad for simple bits of
    java code and JSP's.

    But I feel all 'newbies' should start with non GUI
    apps on the command line, that way, they have a good
    chance of figuring the problems thrown up by
    the more advanced IDE's themselves.

    > ..It's still fragile so you have to make
    > regular backups of your workspaces


    Not the sort of thing a 'newb' should
    have to worry about, eh Sudsy?

    > and it can be obstructive when
    > writing code "heads-down"


    Which is exactly what a 'newb' needs.

    > but it does have its place.


    Yes, coders who are past the 'newb' stage.

    [ I see your point, but in this context I disagree. ]

    YMAV (Y M Apparently V) ;-)

    --
    Andrew Thompson
    http://www.AThompson.info/
    http://www.PhySci.org/
    http://www.1point1C.org/
     
    Andrew Thompson, Nov 16, 2003
    #5
  6. "Leonard Slatkin" <> wrote in message
    news:151120032226051445%...
    > In article <Pjztb.12447$>, Andrew
    > Thompson <> wrote:
    > > "Leonard Slatkin" <> wrote in message
    > > news:151120031448100842%...
    > > >
    > > > I'm taking my first Java course, and we're using the NetBeans IDE.

    ....
    > > If you dump the IDE and check out the sun tutorials,
    > > you are probably going to get much more help here..

    ....
    > Wow, that was very helpful, thank you! Hope it was worth your valuable
    > time.


    YMMV ;-)

    --
    Andrew Thompson
    http://www.AThompson.info/
    http://www.PhySci.org/
    http://www.1point1C.org/
     
    Andrew Thompson, Nov 16, 2003
    #6
  7. Leonard Slatkin

    Sudsy Guest

    Andrew Thompson wrote:
    > "Sudsy" <> wrote in message
    > news:...
    >
    >>Andrew Thompson wrote:
    >>
    >>>"Leonard Slatkin" <> wrote in message
    >>>news:151120031448100842%...
    >>>
    >>>>I'm taking my first Java course, and we're using the NetBeans IDE.
    >>>
    >>>Your instructor is an idiot if they specified you
    >>>use NetBeans to learn Java - use the command line.

    >>
    >>Geez, Andrew! Cut the kid some slack!

    >
    >
    > It is not 'the kid' with whom I have a problem,
    > it is the instructor who does not start his/her
    > students developing 'hello world' apps for
    > the command line.


    On that point I heartily agree! Starting out at the command line
    with the javadocs in a browser window is definitely the best way
    to learn Java.
    But then we might just be swimming against the current. ;-)
     
    Sudsy, Nov 16, 2003
    #7
  8. "Sudsy" <> wrote in message
    news:...
    > Andrew Thompson wrote:

    .....
    > > students developing 'hello world' apps for
    > > the command line.

    >
    > On that point I heartily agree! Starting out at the command line
    > with the javadocs in a browser window is definitely the best way
    > to learn Java.
    > But then we might just be swimming against the current. ;-)


    Only dead fish swim with the current. :)
     
    Andrew Thompson, Nov 16, 2003
    #8
  9. Leonard Slatkin

    Sudsy Guest

    Leonard Slatkin wrote:
    <snip>
    > Wow, that was very helpful, thank you! Hope it was worth your valuable
    > time.


    I think part of the problem is that you haven't defined your
    situation very well. You mention a "main class" when most of
    us are used to a static class method named main. But then you
    can have a main method in each and every one of your classes
    (and many of us program that way in order to perform convenient
    unit testing).
    So perhaps your query would be more appropriate in a forum or
    newsgroup dedicated to netbeans? Either that or you might
    detail the steps you take to run your "main class" and let the
    netbeans afficionados take a stab at it.
    Don't shoot the messenger!
     
    Sudsy, Nov 16, 2003
    #9
    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. Eric McIntyre

    Jar files in Jar files

    Eric McIntyre, May 24, 2004, in forum: Java
    Replies:
    1
    Views:
    478
    Roedy Green
    May 24, 2004
  2. Arnold Peters
    Replies:
    0
    Views:
    581
    Arnold Peters
    Jan 5, 2005
  3. muttley
    Replies:
    0
    Views:
    2,725
    muttley
    Oct 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,766
    Roedy Green
    Feb 14, 2006
  5. Arnold Peters
    Replies:
    0
    Views:
    666
    Arnold Peters
    Jan 5, 2005
Loading...

Share This Page