netbeans - java - Sharing an executable .jar file -


i wrote program in netbeans, , want share coworker. however, when tries running on computer, gets error message:

"could not find main class: excelcomparator.excelcomparator. program exit." 

here's confusing part: wrote on laptop has netbeans, , make sure worked, copied dist folder onto flash drive, , ran on computer. worked fine. when emailed coworker, got error.

based on i've seen, solutions run .jar command line. while might work, need file double-clickable.

i sent coworker file via email in zipped folder, possible unzipping entire folder messed .jar file (don't see why should, included might help)?

this manifest.mf that's within .jar file. there carriage return @ end of file, doesn't copy text box:

manifest-version: 1.0 ant-version: apache ant 1.9.4 created-by: 1.7.0_71-b14 (oracle corporation) class-path: lib/poi-3.12-20150511.jar lib/poi-examples-3.12-20150511.j  ar lib/poi-excelant-3.12-20150511.jar lib/poi-ooxml-3.12-20150511.jar   lib/poi-ooxml-schemas-3.12-20150511.jar lib/poi-scratchpad-3.12-2015  0511.jar x-comment: main-class added automatically build main-class: excelcomparator.excelcomparator 

i sent dist folder, includes lib folder contains additional .jars.

if there's other relevant information need include, let me know. thanks!

if want jar double-clickable should bundle dependencies single jar file.

you achieve using maven assembly plugin: http://maven.apache.org/plugins/maven-assembly-plugin/usage.html

if don't know how use maven, eclipse has nice wizard. i'm not sure how works on netbeans same question has been asked many times, e.g. here netbeans export jar, include library files


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -