Solved

IzPack Shortcut target

Posted on 2004-08-07
4
1,157 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
:-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

772 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

10 Experts available now in Live!

Get 1:1 Help Now