Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > 'dist' jar file doesn't work.

Reply
Thread Tools

'dist' jar file doesn't work.

 
 
MS
Guest
Posts: n/a
 
      02-27-2005
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
 
Reply With Quote
 
 
 
 
Roland
Guest
Posts: n/a
 
      02-28-2005
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_/ /__/
/ \ /_/ / \
 
Reply With Quote
 
 
 
 
MS
Guest
Posts: n/a
 
      02-28-2005
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
 
Reply With Quote
 
MS
Guest
Posts: n/a
 
      03-01-2005
>> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM
how to disassembly a .jar file? how to see what are the classes inside the .jar file? lucy Java 6 09-07-2004 09:54 PM



Advertisments