'dist' jar file doesn't work.

Discussion in 'Java' started by MS, Feb 27, 2005.

  1. MS

    MS Guest

    Hi,

    Using JDK 1.5 and Netbeans 4.0 my application's 'distribution' jar file
    doesn't work properly. The app works perfectly when 'run' from the
    Netbeans GUI, but when run from the 'dist' dir's jar file my app's GUI
    appears but nothing works, at least the buttons to get data from a
    database don't work and all the other functionality requires the data
    first -- none of the error messages are displayed either so no 'can't
    connect to db' or such like. And yes I am remembering to use 'clean and
    build main project' to force the jar dist file to be re-created.

    Any ideas?

    Thanks,

    MS
    MS, Feb 27, 2005
    #1
    1. Advertising

  2. MS

    Roland Guest

    On 27-2-2005 23:19, MS wrote:

    > Hi,
    >
    > Using JDK 1.5 and Netbeans 4.0 my application's 'distribution' jar file
    > doesn't work properly. The app works perfectly when 'run' from the
    > Netbeans GUI, but when run from the 'dist' dir's jar file my app's GUI
    > appears but nothing works, at least the buttons to get data from a
    > database don't work and all the other functionality requires the data
    > first -- none of the error messages are displayed either so no 'can't
    > connect to db' or such like. And yes I am remembering to use 'clean and
    > build main project' to force the jar dist file to be re-created.
    >
    > Any ideas?
    >
    > Thanks,
    >
    > MS

    Run your application from the commandline:
    java -jar dist.jar
    or
    java -classpath dist.jar your.apps.Main

    This should display error messages about missing classes, etc.
    --
    Regards,

    Roland de Ruiter
    ___ ___
    /__/ w_/ /__/
    / \ /_/ / \
    Roland, Feb 28, 2005
    #2
    1. Advertising

  3. MS

    MS Guest

    Roland emailed this:
    > On 27-2-2005 23:19, MS wrote:
    >
    >> Hi,
    >>
    >> Using JDK 1.5 and Netbeans 4.0 my application's 'distribution' jar
    >> file doesn't work properly. The app works perfectly when 'run' from
    >> the Netbeans GUI, but when run from the 'dist' dir's jar file my app's
    >> GUI appears but nothing works, at least the buttons to get data from a
    >> database don't work and all the other functionality requires the data
    >> first -- none of the error messages are displayed either so no 'can't
    >> connect to db' or such like. And yes I am remembering to use 'clean
    >> and build main project' to force the jar dist file to be re-created.
    >>
    >> Any ideas?
    >>
    >> Thanks,
    >>
    >> MS

    >
    > Run your application from the commandline:
    > java -jar dist.jar
    > or
    > java -classpath dist.jar your.apps.Main
    >
    > This should display error messages about missing classes, etc.


    It does thanks.

    I get a NullPointerException, how do you debug this when the app works
    perfectly with no NullPointerException when run from Netbeans which, of
    course, has the debugger in it?!

    Cheers,

    MS
    MS, Feb 28, 2005
    #3
  4. MS

    MS Guest

    >> This should display error messages about missing classes, etc.
    >
    >
    > It does thanks.
    >
    > I get a NullPointerException, how do you debug this when the app works
    > perfectly with no NullPointerException when run from Netbeans which, of
    > course, has the debugger in it?!


    Solved -- the jar file was being run by the java.exe in the JRE not in the
    JDK and the JRE did not have the DB stuff setup.

    MS
    MS, Mar 1, 2005
    #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. Arnold Peters
    Replies:
    0
    Views:
    567
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,717
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,752
    Roedy Green
    Feb 14, 2006
  4. Steve Pinard

    sort() doesn't work on dist.keys() ?

    Steve Pinard, Jul 10, 2003, in forum: Python
    Replies:
    5
    Views:
    449
    Greg Fortune
    Jul 11, 2003
  5. Replies:
    20
    Views:
    11,498
Loading...

Share This Page