FAQ: How can I fix a "Cannot load Java Virtual Machine" error (memory limit set too high)? and FAQ: How can I view the debugging output of MIPAV?: Difference between pages

From MIPAV
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
MIPAV>Olga Vovk
mNo edit summary
 
Line 1: Line 1:
Sometimes MIPAV will not load if the memory limit is set too high (due to user error or another program -- like antivirus -- staying resident in memory)Usually the user will see an error saying something like "Cannot load Java Virtual Machine".
'''NOTE:''' The below text is taken from the InstallAnywhere 2009 user manualIt applies to both the debugging the MIPAV installers and debugging an installed MIPAV instance (i.e., C:\Program Files\mipav\mipav.exe). [http://www.acresso.com/webdocuments/PDF/ug_ia_2009.pdf]


== Windows/Linux ==
----


# Open the MIPAV LanuchAnywhere configuration file in a text editor:
#* Windows example: C:\Program Files\mipav\mipav.lax
#* Linux example: /path/to/mipav/mipav.lax
# Find the part of the file that resembles the below snippet (here the memory limit is ~1GB):
<pre>
#  LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL
#  -----------------------------------------
#  Java start up heap size


lax.nl.java.option.java.heap.size.initial=1000000000
==Debugging a Win32 installer==




#  LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX
To view or capture the debug output from a Win32 installer, hold down the <CTRL> key immediately
#  -------------------------------------
after launching the installer and until a console window appears. Before exiting the installer, copy the
#  Java maximum heap size
console output to a text file for later review.


lax.nl.java.option.java.heap.size.max=1000000000
</pre>
# Change the number at the end of both property lines to a lower number (try 100000000 -- ~100MB to test).
# Restart MIPAV.
# Try increasing the memory limit to something more reasonable, testing to make sure that MIPAV still starts after the change.


== MacOS X ==
On some Windows NT systems, run the installer once with the <CTRL> key down, resetting the scroll
back buffer for the console window, then quit and run the installation again.


# Open the MIPAV LanuchAnywhere configuration file in a text editor:
#* Example: /Applications/mipav/mipav.app/Contents/Info.plist
# Find the part of the file that resembles the below snippet (here the memory limit is ~1GB):
<pre>
<key>VMOptions</key>
<array>
    <string>-Xms1000M</string>
    <string>-Xmx1000M</string>
    <string>-server</string>
</array>
</pre>
# Change the number in the lines containing the "-Xms" and "-Xmx" VM options to a lower number (try 100M to test).
# Restart MIPAV.
# Try increasing the memory limit to something more reasonable, testing to make sure that MIPAV still starts after the change.


If there are problems capturing the console output, try a slightly more convoluted method (this will often
be the case on Win9x because of the limited ability of the console to capture output). First launch the
installer and allow it to extract the necessary files. Once it reaches the Preparing to Install window,
when given the opportunity to choose a language or to go to the Windows temp directory, look for a temp
folder which starts with an I followed by many numeric digits (for example: I1063988642). Be sure it is
the most recent directory by sorting the directories by their modified date. Open the directory, there
should be a file called sea_loc. Delete this file. Now return to the installer, click OK, and at the first
opportunity, cancel the installation.
Now go back to the directory inside the temp directory, where the file sea_loc was deleted. There should
be another directory called Windows; open it. There should be an .exe file (most likely install.exe). There
should also be another file with the same name except it will have a .lax extension. Open it with a text
editor and set the lax.stderr.redirect and lax.stdout.redirect properties:
lax.stderr.redirect=output.txt
lax.stdout.redirect=output.txt
After these changes have been made, save the file and launch the .exe. When the installation is complete
there should be an output.txt file in the same directory as the .lax file. The output.txt file contains the
same information as that sent to the console.
==Debugging a Unix/Linux or Pure Java Installer==
To debug Unix/Linux installers and Pure Java installers without access to the InstallAnywhere
Advanced Designer, set LAX_DEBUG to True.
===To capture the debug output from the Unix command line===
1. Enter one of the following (based on which shell) at the command line:
export LAX_DEBUG=true
setenv LAX_DEBUG true
LAX_DEBUG=true
set LAX_DEBUG
Note: Use whatever syntax is appropriate for the Unix shell being used.
2. Run the installer. The output that is produced is sent to the console.
===To capture debug output from a Pure Java installer===
At the command line, start the Pure Java installer and pass the -DLAX_DEBUG=true option to the JVM. For
example:
java -DLAX_DEBUG=true -jar install.jar
Like setting a LAX_DEBUG environment variable for Unix/Linux installers, passing the LAX_DEBUG
Java property to a Pure Java installer sends debug output to the console.
==Debugging a Mac OS X Installer==
InstallAnywhere utilizes the standard output layers in Mac OS X to display output. To gather debugging
output from an OS X installer, launch Console.app (found in /Applications/Utilities). To retain this
information, cut and paste information from the console window to a file.
If you do not see debug output from an installer, check the Info.plist file inside the installer. To do this,
Control-click (or right-click) on the installer and select Show Package Contents. Inside the Contents
folder you will see an XML file named Info.plist. You’ll need to change:
<key>lax.stderr.redirect</key>
<string></string>
<key>lax.stdout.redirect</key>
<string></string>
to
<key>lax.stderr.redirect</key>
<string>console</string>
<key>lax.stdout.redirect</key>
<string>console</string>
When you relaunch the installer, the installer output should be now listed in Console.app.


== See also: ==
== See also: ==
Line 48: Line 94:
*[[Opening and loading image files]]  
*[[Opening and loading image files]]  


Next: [[FAQ: Understanding Memory]]
Next: [[FAQ: Customizing MIPAV]]


[[Category: Help]]
[[Category: Help]]


[[Category: FAQ]]
[[Category: FAQ]]

Revision as of 19:39, 13 June 2012

NOTE: The below text is taken from the InstallAnywhere 2009 user manual. It applies to both the debugging the MIPAV installers and debugging an installed MIPAV instance (i.e., C:\Program Files\mipav\mipav.exe). [1]



Debugging a Win32 installer

To view or capture the debug output from a Win32 installer, hold down the <CTRL> key immediately after launching the installer and until a console window appears. Before exiting the installer, copy the console output to a text file for later review.


On some Windows NT systems, run the installer once with the <CTRL> key down, resetting the scroll back buffer for the console window, then quit and run the installation again.


If there are problems capturing the console output, try a slightly more convoluted method (this will often be the case on Win9x because of the limited ability of the console to capture output). First launch the installer and allow it to extract the necessary files. Once it reaches the Preparing to Install window, when given the opportunity to choose a language or to go to the Windows temp directory, look for a temp folder which starts with an I followed by many numeric digits (for example: I1063988642). Be sure it is the most recent directory by sorting the directories by their modified date. Open the directory, there should be a file called sea_loc. Delete this file. Now return to the installer, click OK, and at the first opportunity, cancel the installation.


Now go back to the directory inside the temp directory, where the file sea_loc was deleted. There should be another directory called Windows; open it. There should be an .exe file (most likely install.exe). There should also be another file with the same name except it will have a .lax extension. Open it with a text editor and set the lax.stderr.redirect and lax.stdout.redirect properties:

lax.stderr.redirect=output.txt
lax.stdout.redirect=output.txt

After these changes have been made, save the file and launch the .exe. When the installation is complete there should be an output.txt file in the same directory as the .lax file. The output.txt file contains the same information as that sent to the console.


Debugging a Unix/Linux or Pure Java Installer

To debug Unix/Linux installers and Pure Java installers without access to the InstallAnywhere Advanced Designer, set LAX_DEBUG to True.


To capture the debug output from the Unix command line

1. Enter one of the following (based on which shell) at the command line:

export LAX_DEBUG=true
setenv LAX_DEBUG true
LAX_DEBUG=true
set LAX_DEBUG

Note: Use whatever syntax is appropriate for the Unix shell being used.

2. Run the installer. The output that is produced is sent to the console.


To capture debug output from a Pure Java installer

At the command line, start the Pure Java installer and pass the -DLAX_DEBUG=true option to the JVM. For example:

java -DLAX_DEBUG=true -jar install.jar

Like setting a LAX_DEBUG environment variable for Unix/Linux installers, passing the LAX_DEBUG Java property to a Pure Java installer sends debug output to the console.


Debugging a Mac OS X Installer

InstallAnywhere utilizes the standard output layers in Mac OS X to display output. To gather debugging output from an OS X installer, launch Console.app (found in /Applications/Utilities). To retain this information, cut and paste information from the console window to a file.


If you do not see debug output from an installer, check the Info.plist file inside the installer. To do this, Control-click (or right-click) on the installer and select Show Package Contents. Inside the Contents folder you will see an XML file named Info.plist. You’ll need to change:

<key>lax.stderr.redirect</key>
<string></string>
<key>lax.stdout.redirect</key>
<string></string>

to

<key>lax.stderr.redirect</key>
<string>console</string>
<key>lax.stdout.redirect</key>
<string>console</string>

When you relaunch the installer, the installer output should be now listed in Console.app.

See also:

Next: FAQ: Customizing MIPAV