Solved

IzPack Shortcut target

Posted on 2004-08-07
4
1,158 Views
Last Modified: 2007-12-19
I am using the following shortcutSpec.xml file for creating shortcut with IzPack

<shortcuts>
  <programGroup defaultName="Name of the Program Group"
                location="applications/startMenu"/>
<shortcut
     name="MTShortcut"
     target='$JAVA_HOME/bin/javaw.exe -classpath ..\log4j-1.2.7.jar;'
     commandLine='com.main.MApp'
     workingDirectory="$INSTALL_PATH/src/classes"
     description="A description"
     initialState="maximum"
     programGroup="no"
     desktop="yes"
     applications="no"
     startMenu="yes"
     startup="no">
</shortcut>

</shortcuts>

But the problem is in the target it displays double quotes

"D:\JBuilder8\jdk1.4\jre\bin\javaw.exe -classpath ..\log4j-1.2.7.jar;" com.main.MApp
If i manually remove the double quotes it works fine.

If i omit the classpath code "-classpath ..\log4j-1.2.7.jar;" then in the target it doesn't display double quotes but then the shortcut doesn't work as it needs classpath.

Please tell me  how can i retain the classapath and get rid of double quotes so that the shortcut works.
0
Comment
Question by:thomas908
  • 3
4 Comments
 
LVL 13

Expert Comment

by:Webstorm
ID: 11742429
Hi thomas908,

Try to move the classpath in the commandLine attribute:


<shortcut
     name="MTShortcut"
     target='$JAVA_HOME/bin/javaw.exe'
     commandLine='-classpath ..\log4j-1.2.7.jar; com.main.MApp'
...
0
 
LVL 8

Author Comment

by:thomas908
ID: 11750011
thanks Webstorm  
It works great. But there is another problem now. Classpath has become sort of huge something like

commandLine='-classpath ..\log4j-1.2.7.jar;.;..\mysql-connector-java-3.0.6-stable-bin.jar;..\conf.jar;..\datasocket.jar;..\photos.jar;..\help\jsearch.jar;..\help\jhall.jar;..\help\jhbasic.jar;..\help\jh.jar;..\thirdparty\xercesImpl.jar;..\thirdparty\xmlParserAPIs.jar; com.pack1.pack2.pack3.App'

Due to some reason the target in the shortcut truncates it. May be there is a limit to the number of characters in the target.
How can i solve this.

0
 
LVL 13

Accepted Solution

by:
Webstorm earned 500 total points
ID: 11750799
You can try to shorten the classpath, by modifying the starting directory (parent), so you can remove all the ../ in the classpath :

<shortcut
     name="MTShortcut"
     target='$JAVA_HOME/bin/javaw.exe'
     commandLine='-classpath log4j-1.2.7.jar;classes;mysql-connector-java-3.0.6-stable-bin.jar;conf.jar;datasocket.jar;photos.jar;help\jsearch.jar;help\jhall.jar;help\jhbasic.jar;help\jh.jar;thirdparty\xercesImpl.jar;thirdparty\xmlParserAPIs.jar; com.pack1.pack2.pack3.App'
     workingDirectory="$INSTALL_PATH/src"
     description="A description"
     initialState="maximum"
     programGroup="no"
     desktop="yes"
     applications="no"
     startMenu="yes"
     startup="no">
</shortcut>

You can also move all the jar archive files you need to the same directory, and remove directories from the classpath.
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 11750979
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Impossible to extract MSI from new JAVA releases 2 48
maven example error 3 52
Java Loop 6 49
Basic Java Case or If-Else statement... 3 43
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now