Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Including directories in a JAR

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on a program which uses packages from JAVAMAIL. The dir structure where my program is stored is:
progDir
program classes
+-->lib
JAVAMAIL jars

I included the JAVAMAIL dir and IMAGES dir while making the JAR file of the program using this command:
jar -cvfm mmc.jar Manifest.mf *.class -C lib/
My manifest looks like this:
Main-Class: mmc
Class-Path: lib/activation.jar lib/imap.jar lib/mail.jar lib/mailapi.jar lib/pop3.jar lib/smtp.jar
My Jar is not able to run like the normal program. It does not read the packages in the lib folder even when I have listed them in Class-Path.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You JavaMail jars need to go in the /ext directory of the JRE.
This is an extension tutorial.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic