Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to add/modify to this icon that runs the jar

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I build a jar of a GUI App, and when appear it in desktop, when clicked App (java se) opens, well
If I want to add/modify to this icon that runs the jar, more properties like change icon, or ... what to do?
I also have JEDIT (Java app) which ratherwise, you can change the icon by, right click icon>properties
and runs with
C:\WINDOWS\System32\javaw.exe -Xmx192M -jar "C:\Program Files\jEdit\jedit.jar" -reuseview

well?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the actual JAR file on the desktop, or a shortcut to the JAR? It would be better if you had a shortcut, then you should be able to right-click the icon, go to Properties and change the icon.

What version of Windows are you using?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the actual JAR file on the desktop using vista... to make shortcut right-click>send to desktop? and after change icon?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did it ,...is any way change and java icon in task bar windows and left top in the window gui of jar run program? from java i guess, how?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • 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...
PLEASE NOTE THE ONLY LIBRARY INCLUDED IS MAIL.JAR
lib/mail.jar in the same jar folder

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

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that the mail.jar is not being picked up when your run your app from the shortcut. When running a JAR file directly it should be self-contained, that it, the JAR file contains all classes necessary to run the app (well, almost, you don't have to include rt.jar). Since your app depends on mail.jar, I suggest that you create a .bat file that contains something like this:

java -classpath /path/to/mail.jar;/path/to/yourapps.jar your.main.Class

Then place a shortcut to this bat file on your desktop.

Alternately, you can use the Class-Path attribute within your JAR file to reference the mail.jar. See this:
http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html#download
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is correct? that you refer in url?

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic