Solved

IzPack Shortcut target

Posted on 2004-08-07
4
1,171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jboss 7.1 start up error 1 83
Tagging and Merging on Branch 1 68
jmeter usage 4 62
Strange router problem - can't access hotmail.com 14 108
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

734 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