We need you!

Icon

The IzPack documentation needs work, and you are invited to edit it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. This is assuming that you're current Unix/Linux allows the use of the server X. In cas it doesn't here is a way to install IzPack using cygwin (thanks to Shrish Buradkar and Bartz Klaus for this trick):
    Install cygwin on a remote machine. Cygwin can be downloaded from http://www.cygwin.com/ Firstly, start the XWindows server on your PC. This could be done by using the startxwin-multiwindow batch file or running /usr/X11R6/bin/startxwin.sh From the cygwin Xterm, type xhost + Then telnet to the remote UNIX/Linux machine and set the DISPLAY to your PC. So after you have logged into the remote machine, do export DISPLAY=pc-ip-adress:0.0 xterm & java -jar installer.jar This should do the job by displaying an xterm from the remote machine onto yor PC.
  2. Normally launching packages created by IzPack under Gnome, KDE or XFCE works fine. If when trying to launch a pack you receive this error message:

    Code Block
    Exception in thread "main" java.lang.InternalError: Can't connect to X11
    window server using ':0.0' as the value of the DISPLAY variable.
            at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
            at
    sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:134)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:141)
            at
    java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
            at java.awt.Font.initializeFont(Font.java:308)
            at java.awt.Font.<init>(Font.java:344)
            at
    com.izforge.izpack.gui.IzPackMetalTheme.createFont(IzPackMetalTheme.java:62)
            at
    com.izforge.izpack.gui.IzPackMetalTheme.<init>(IzPackMetalTheme.java:52)
            at
    com.izforge.izpack.gui.IzPackKMetalTheme.<init>(IzPackKMetalTheme.java:59)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)
            at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
            at java.lang.Class.newInstance0(Class.java:308)
            at java.lang.Class.newInstance(Class.java:261)
            at
    com.izforge.izpack.installer.GUIInstaller.loadLookAndFeel(GUIInstaller.java:297)
            at
    com.izforge.izpack.installer.GUIInstaller.<init>(GUIInstaller.java:100)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)
            at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
            at java.lang.Class.newInstance0(Class.java:308)
            at java.lang.Class.newInstance(Class.java:261)
            at com.izforge.izpack.installer.Installer.main(Installer.java:47)

...

Here are the steps needed to develop adn and debug IzPack with Eclipse:

  1. IzPack Installation
    Install the latest stable release of IzPack with the sources ! For more details see the section "IzPack Installation".
  2. Custom class sources and build.xml
    Put your custom class sources under %IZPACK_HOME%srclib may be %IZPACK_HOME%srclibcomizforgeizpackpanelsMyPanel.java Add a create rule into %IZPACK_HOME%srcbuild.xml under target "build.panels"
  3. Eclipse
    You can get Eclipse from http://www.eclipse.org/downloads/index.php
  4. Create IzPack project
    Select File > New > Project... Java > Java Project > next > give a project name like "IzPack" deselect "Use default" ( 2.x) or select "Create project at external location" (3.x) Browse to %IZPACK_HOME%srclib select it Next > In "Libraries" select "Add External JARs..." select ant.jar and jakarta-regexp-1.3.jar from %IZPACK_HOME%lib Finish
  5. Debug compile (create installation)
    Select Run > Debug... Java Application New give a name e.g. "CompileMyInstall" select in "Main" the project "IzPack" select as "main class" "Compile" (from package com.izforge.izpack.compiler) As "Program arguments" put in (for %SOME_THING% use your local value) %SRC_ROOT%%CONFIG_SUBPATH%install.xml -b %SRC_ROOT% -o %INSTALLER_DEST%install.jar As "VM arguments" put in "-DIZPACK_HOME=n:homebartzkauworkxt150_forIzPackizpack-src"
    No you can debug the compiling of your installation.
  6. Debug installation
    Compile your installation; now you have %INSTALLER_DEST%install.jar Run > Debug... Java Application New give a name e.g. "InstallMyInstall" select in "Main" the project "IzPack" select as "main class" "Installer" (from package com.izforge.izpack.installer) as "VM arguments" use -DTRACE=true select the tab "Classpath" select "User classes" (2.x) or "User Entries" (3.x) select "Add External JARs..." select %INSTALLER_DEST%install.jar (may be, that's the trick...) install.jar must be under the project entry
    BUGS and TROUBLESHOOTING
    If you get this error when running the application could not create shortcut instance

    Code Block
    java.lang.Exception: error loading library
    at com.izforge.izpack.util.Librarian.loadLibrary(Librarian.java:249)
    at com.izforge.izpack.util.os.ShellLink.initialize(ShellLink.java:461)
    at com.izforge.izpack.util.os.ShellLink.<init>(ShellLink.java:349)
    at com.izforge.izpack.util.os.Win_Shortcut.initialize(Win_Shortcut.java:79)
    at com.izforge.izpack.panels.shortcut.ShortcutPanel.<init>(ShortcutPanel.java:473)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.izforge.izpack.installer.InstallerFrame.loadPanels(InstallerFrame.java:203)
    at com.izforge.izpack.installer.InstallerFrame.<init>(InstallerFrame.java:160)
    at com.izforge.izpack.installer.GUIInstaller.loadGUI(GUIInstaller.java:391)
    at com.izforge.izpack.installer.GUIInstaller.<init>(GUIInstaller.java:128)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.izforge.izpack.installer.Installer.main(Installer.java:62)

    then it means you forgot to put the shelllink.dll into the correct source folder in that case, copy %IZPACK_HOME%binnativeizpackShellLink.dll to %IZPACK_HOME%srclibcomizforgeizpackutilosShellLink.dll
    Now you can debug the installation. With 2.x you can edit on demand, if %INSTALLER_DEST%install.jar is shown in "Classpath" under the project. With 3.x it seems so, that always the JAR will be loaded; therefore the contents of install.jar and the sources should be synchron.

  7. Debug uninstallation
    Install your installation to %INSTALL_PATH% Run > Debug... Java Application New give a name e.g. "UninstallMyInstall" select in "Main" the project "IzPack" select as "main class" "Uninstaller" (from package com.izforge.izpack.installer) as "VM arguments" use -DTRACE=true select the tab "Classpath" select "User classes" (2.x) or "User Entries" (3.x) select "Add External JARs..." select %INSTALL_PATH%Uninstalleruninstall.jar uninstall.jar must be under the project entry
    Now, you can debug your uninstallation. Don't worry if you get first a NullPointerException in SelfModifier. This should be; it is a hint, that the class files of your eclipse session are used. If debugging not working, look whether: there is a fresh installation the uninstall.jar is in the "Classpath" tab under the project entry

...