• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I found that inner classes cause problem run my jar file (no problem making the jar or compiling),

 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found that inner classes cause problem run my jar file (no problem making the jar or compiling), well in this case of inner classes what must be done?

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jar cmf SMTPClient.mf SMTPClient.jar SMTPClient.class SMTPClient.java success
java -jar SMTPClient.jar
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you create your JAR file you're only adding SMTPClient.class and SMTP.java. Inner classes are compiled to their own class files, in this case SMTPClient$SendAction.class. You'll need to include that in the JAR file.
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how include inner classes below:
SMTPClient$SendAction.class
or
SendAction.class
??
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
either is correct?
I triedbut is it needed alsi include javax/mail/Message class, where found?>>>>


 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
subject:javax.mail.Message
I used
jar cmf SMTPClient.mf SMTPClient.jar SMTPClient.class SMTPClient$SendAction.class SMTPClient$UpdateListener.class mail.jar SMTPClient.java

but gives (how include another jar in my jar?)
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://one-jar.sourceforge.net/
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:http://one-jar.sourceforge.net/



I get some hint although confused,
after I put from RAR zip utility a folder(/lib) and mail.jar in, I get below...is any special command in manifest or to run? Is mail.jar the only I need or?

 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put a Class-Path entry in your manifest file which points to the location of mail.jar relative to your own JAR file. For example, "Class-Path: mail.jar" or "Class-Path: lib/mail.jar".
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get again error...???
how add a jar in a folder, of another jar from CLI LIKE
jar cmf SMTPClient.mf SMTPClient.jar SMTPClient.class SMTPClient$SendAction.class SMTPClient$UpdateListener.class mail.jar SMTPClient.java
?
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't put mail.jar inside the JAR file. You put it in a lib folder that exists in the same folder as your JAR folder. Very few solutions allow you to add dependency JAR file inside the JAR file itself and work immediately. One JAR, as Maneesh suggested, is one of those but I've never used it.
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hence this is a simple GUI EMAIL SEND FORM APP JAVA SE, When on RUN from CLI I email delivered but not delivered when RUN by clicking shortcut...
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have the following in the folder where the JAR is located?
Because with a Class-Path entry of lib/mail.jar that's what it should look like.
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is correct?

Manifest-Version: 1.0
Created-By: 1.6.0_15 (Sun Microsystems Inc.)
Class-Path: lib/mail.jar
Main-Class: SMTPClient

app run only CLI, No:jar run / shortcut run

no errors only email not delivered... folder structure correct

matters many jars in containing folder, or folder url with spaces?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first time running jars[gui] non-success, needed anything else from mail.jar any other lib?

in shortcut
target:"C:\Users\User\Documents\TextBooksDataFiles\Java Network Programming, 3rd Edition\jnp3examples\examples\19\SMTPClient.jar"
startin:"C:\Users\User\Documents\TextBooksDataFiles\Java Network Programming, 3rd Edition\jnp3examples\examples\19"
the jar is in the
C:\Users\User\Documents\TextBooksDataFiles\Java Network Programming, 3rd Edition\jnp3examples\examples\19\lib\mail.jar

only from running [CLI] the- java SMTPClient .class -email delivered

this is correct ... how many lines must follow: SMTPClient?

Manifest-Version: 1.0
Class-Path: lib/mail.jar
Created-By: 1.6.0_15 (Sun Microsystems Inc.)
Main-Class: SMTPClient

in this case mail.jar needed ONLY outside the SMTPClient.jar?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I run
java -jar SMTPClient.jar // CLI
->simple send email, but when press send button appeared:
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you included all .class files generated by the compiler, in the right folder structure that must match the package structure?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added SMTPClient$SendAction$1 and now works, thks!

in the above class name "$" show inner classes? may included in any order in->...?

jar cmf SMTPClient.mf SMTPClient.jar SMTPClient.class SMTPClient$SendAction.class SMTPClient$SendAction$1.class SMTPClient$UpdateListener.class SMTPClient$1.class SMTPClient$2.class SMTPClient$3.class SMTPClient$4.class SMTPClient.java
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
$1 etc are anonymous inner classes. As you already have seen, named inner classes have their name added, like SMTPClient$SendAction.class. The order is most likely the order of occurrence in the source file but I don't know if the Java Language Specification has a hard rule for this.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic