Increase memory for executable JAR (not -mx)

My app runs out of memory, but I can't use the -mx flag because I want the Windows user to be able to double click the .jar file to execute it. Is there a way to either specifiy in the jar file, in the manifest, or programmatically to increase the max memory available? Surely there must be a way because it's pretty sad that the user has to fall back to typing in -mx themselves on the command line.

>
My app runs out of memory, but I can't use the -mx
flag because I want the Windows user to be able to
double click the .jar file to execute it. Is there a
way to either specifiy in the jar file, in the
manifest, No.
or programmatically to increase the max
memory available? The registry key. Or change it under FileTypes in explorer under Tools->'folder options'
Or create a batch file.
Surely there must be a way because
it's pretty sad that the user has to fall back to
typing in -mx themselves on the command line.Java is cross platform compatible.
The JVM is not.
InstallShield provides a multitude of ways to handle problems like that along with providing a familar installation method for the user.
You might also look at "Java Web Start".

Similar Messages

  • How to increase memory for building project using ant in ECLIPSE

    Hi All,
    for all java projects and java applications in eclipse i am giving -Xms and -Xmx to increase heap memory.
    But the same failed when i run ant. it says Out of Memory Error.eventhough i had 1GB ram in system.
    How to increase memory for Building through ANT.
    Thanks,
    J.Kathir

    even if this is not a eclipse forum
    In the package explorer view or navigator view right click on the build file select "Run as / Ant Build ...". On the JRE Tab you can enter the VM Aguments like -Xmx512m
    Consult the java dokumentation how to set the memory of the jvm.

  • Increase memory for QuarkXPress

    how do i increase memory for QuarkXPress?

    Install more RAM.
    Memory Management in OS X:
    http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt /Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW1

  • Classpath is not working for executable jar file

    I have created executable jar file using following command where manifest file contains Main-Class and Class-Path entries.
    jar cvfm app.jar META-INF/* lib/* *.class
    So here app.jar contains my external jar's in lib directory
    but when I move app.jar to another directory, it's doesn't get my external files.
    I'm not getting this problem as these jar's are in app.jar
    class-path entry in manifest file:
    Class-Path: lib/abc.jar lib/xyz.jar
    Pls help me where it is getting fail?
    Thanks in advance,
    Vikas

    Java doesn't handle jars within jars. Your library jars need to be outside of the executable jar as in
    dist - main.jar
          - lib  -  lib1.jar
                 -  lib2.jar

  • Query JVM for executing JAR absolute path

    Good morning
    In order to use resources in an executed JAR file, I use the following :
    URL url = JARFILENAME.class.getResource(myResourceRelativePath);But, JARFILENAME is the name of the JAR file which is being executed and I would not like it to be hard coded. Is there anyway to query the JVM the absolute path of the executed JAR file ?
    Thanks a lot
    Christophe

    Good Afternoon everybody,
    Thank you very much Owen ! Your words were very helpful to me.
    In order to help other people who would like to process text files embedded in an executable JAR file, here all my sources for this example.
    HOW TO PROCESS TEXT FILES EMBEDDED IN AN EXECUTABLE JAR FILE WITH PACKAGED CLASS FILES
    File list for the project (after executing the makefile) :
    .\build
    .\docs
    .\src
    .\makefile.bat
    .\JarTextResourcesReaderDemo.jar
    .\sources.txt
    .\JarTextResourcesReaderDemo(Sources).zip
    .\build\cbismuth
    .\build\txt
    .\build\manifest.mf
    .\build\cbismuth\demos
    .\build\cbismuth\utils
    .\build\cbismuth\demos\JarTextResourcesReaderDemo.class
    .\build\cbismuth\utils\jar
    .\build\cbismuth\utils\jar\textreader
    .\build\cbismuth\utils\jar\textreader\JarTextResourcesReader.class
    .\build\txt\myTextFile.csv
    .\docs\cbismuth
    .\docs\package-list
    .\docs\resources
    .\docs\stylesheet.css
    .\docs\allclasses-frame.html
    .\docs\allclasses-noframe.html
    .\docs\constant-values.html
    .\docs\deprecated-list.html
    .\docs\help-doc.html
    .\docs\index.html
    .\docs\index-all.html
    .\docs\JarTextResourcesReader.html
    .\docs\JarTextResourcesReaderDemo.html
    .\docs\overview-frame.html
    .\docs\overview-summary.html
    .\docs\overview-tree.html
    .\docs\package-frame.html
    .\docs\package-summary.html
    .\docs\package-tree.html
    .\docs\cbismuth\demos
    .\docs\cbismuth\utils
    .\docs\cbismuth\demos\JarTextResourcesReaderDemo.html
    .\docs\cbismuth\demos\package-frame.html
    .\docs\cbismuth\demos\package-summary.html
    .\docs\cbismuth\demos\package-tree.html
    .\docs\cbismuth\utils\jar
    .\docs\cbismuth\utils\jar\textreader
    .\docs\cbismuth\utils\jar\textreader\JarTextResourcesReader.html
    .\docs\cbismuth\utils\jar\textreader\package-frame.html
    .\docs\cbismuth\utils\jar\textreader\package-summary.html
    .\docs\cbismuth\utils\jar\textreader\package-tree.html
    .\docs\resources\inherit.gif
    .\src\cbismuth
    .\src\cbismuth\demos
    .\src\cbismuth\utils
    .\src\cbismuth\demos\JarTextResourcesReaderDemo.java
    .\src\cbismuth\utils\jar
    .\src\cbismuth\utils\jar\textreader
    .\src\cbismuth\utils\jar\textreader\JarTextResourcesReader.java[b]File .\sources.txt :
    .\src\cbismuth\utils\jar\textreader\JarTextResourcesReader.java
    .\src\cbismuth\demos\JarTextResourcesReaderDemo.java[b]File .\makefile.bat :
    @title Java Project Compilation
    @echo off
    echo ------------------
    echo Old Files Deletion
    echo ------------------
    del /f /q *.zip
    del /f /q *.jar
    del /f /q build\cbismuth
    echo -----------
    echo Compilation
    echo -----------
    javac -O -deprecation -d build @sources.txt
    echo -------------------
    echo Java Doc Generation
    echo -------------------
    javadoc -author -version -private -windowtitle JarTextResourcesReaderDemo -d docs @sources.txt
    echo -------------------------
    echo Executable JAR Generation
    echo -------------------------
    cd build
    jar -cvfm JarTextResourcesReaderDemo.jar .\manifest.mf *
    move JarTextResourcesReaderDemo.jar ..
    cd ..
    echo ----------------------
    echo ZIP Project Generation
    echo ----------------------
    jar -cvf JarTextResourcesReaderDemo(Sources).zip *[b]File .\src\cbismuth\utils\jar\textreader\JarTextResourcesReader.java :
    package cbismuth.utils.jar.textreader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.lang.NullPointerException;
    import java.lang.IndexOutOfBoundsException;
    public class JarTextResourcesReader {
      protected BufferedReader[] readers = null;
      public JarTextResourcesReader(String[] paths) throws NullPointerException {
        int nbFiles = paths.length;
        readers = new BufferedReader[nbFiles];
        for (int i = 0; i < nbFiles; i++) {
          InputStream inputStream = this.getClass().getResourceAsStream(paths);
    this.readers[i] = new BufferedReader(new InputStreamReader(inputStream));
    if (readers[i] == null) {
    throw(new NullPointerException());
    public void print() {
    for (int i = 0; i < readers.length; i++) {
    String line = null;
    try {
    while((line = readers[i].readLine()) != null) {
    System.out.println(line);
    catch(IOException e) {
    // exception managment
    public BufferedReader getReaderAt(int i) throws IndexOutOfBoundsException {
    if (i > this.readers.length) {
    throw(new IndexOutOfBoundsException());
    else {
    return(this.readers[i]);
    public BufferedReader[] getReaders() {
    return(this.readers);
    public void close() {
    for (int i = 0; i < this.readers.length; i++) {
    try {
    readers[i].close();
    catch(IOException e) {
    // exception managment
    File .\src\cbismuth\demos\JarTextResourcesReaderDemo.java :
    package cbismuth.demos;
    import cbismuth.utils.jar.textreader.JarTextResourcesReader;
    public class JarTextResourcesReaderDemo {
      public static void main(String[] args) {
        String[] paths = new String[1];
        paths[0] = "/txt/myTextFile.csv";
        JarTextResourcesReader jtrr = new JarTextResourcesReader(paths);
        jtrr.print();
        jtrr.close();
    }[b]File .\build\txt\myTextFile.csv :
    Line 1 Column 1;Line 1 Column 2;Line 1 Column 3
    Line 2 Column 1;Line 2 Column 2;Line 2 Column 3[b]File .\build\manifest.mf :
    Main-Class: cbismuth.demos.JarTextResourcesReaderDemo
    [BLANK LINE !]NOTE : a blank line MUST be left at the end of the MANIFEST file !
    [b]Command line to execute the JAR file in the root directory :
    java -jar JarTextResourcesReaderDemo.jar[b]Output :
    Line 1 Column 1;Line 1 Column 2;Line 1 Column 3
    Line 2 Column 1;Line 2 Column 2;Line 2 Column 3[b]Special thanks to Owen !
    See you soon,
    Christophe

  • ClassCastException in executable JAR not inside IDE

    I have a problem running my application outside Eclipse. It gives ClassCastException at the place where the application inside IDE does not. In particular, I output to the terminal the name of the instance I'm trying to cast and inside IDE it gives the correct type such as "NestedEngineImpl" whereas outside IDE it gives "EngineImpl" with the exception that EngineImpl cannot be cast to NestedEngineImpl. NestedEngineImple extends EngineImpl.The executable jar has been created using Eclipse' Export Runnable JAR file. The jar opens and runs until the point of exception.
    Any advice will be greatly appreciated.

    The application works fine inside Eclipse. These classes are built from the source code in the project. When I output the instance I'm trying to cast with .getClass().getName() it returns NestedEngineImpl, meaning that it can be cast to NestedEngineImpl. When the applications runs in standalone, the output is EngineImpl and the cast fails. Why is the output EngineImpl?
    Edited by: 807433 on Nov 4, 2010 3:30 PM

  • Increase memory for FCP ?

    Hi there,
    Could someone tell me if there is any way to increase the memory allocated to FCP ?
    Sometimes, I get a "out of memory message" while the memory available is still more than 5 Gb .... according to activity monitor.
    Thanks in advance
    Ivan

    My understanding is that the maximum pixel dimensions for stills is 4000x4000 pixels. So make sure they are within this size. Not sure if jpegs can be cmyk.
    Also, are you dealing with image sequences? If so, use quicktime to convert image sequences to quicktimes. FCP will choke on too many stills. i've never gotten the out of memory error, just had things slow to a crawl.

  • Auto-generated executable jar not working properly

    Hi all,
    I have a desktop application. that I can run it from Netbeans with all its functionalities but when I click the generated jar file the application run wel but some of its functionalities was not working.
    Any idea ...
    Thank you in advance

    Yousef_Aqarbeh wrote:
    I have a desktop application. that I can run it from Netbeans with all its functionalities but when I click the generated jar file the application run wel but some of its functionalities was not working.Possibly you have not added your resources to the Jar file or are trying to get these resources as files, and files don't exist inside of Jars (AFAIK).
    Any idea ...For more help, better help, and helpful help, create a [Short, Self Contained, Correct (Compilable), Example|http://sscce.org] or SSCCE. This is a small program that compiles, runs, demonstrates your problem, and contains no extraneous code. Please read the link, and have a go at it. Best of luck.

  • Turn off display on sql*plus and increase memory for oracle?

    I want to turn off the output display on SQL*PLUS window and SPOOL the output to a file since the result is very big. i tried to SET TERM OFF but it doesn't work. Anybody knows what's the problem? or is there some other commands to use? My oracle is 9i. thx!!! And anybody knows how to increase the memory usage size for Oracle's jrew.exe? it's too slow when i try to retrieve some big size data from oracle.

    I just answered this question on the OTN -> General forum. You could try the SQL*Plus startup switch -s to startup SQL*Plus in silent mode, eg:
    C:\SQLPLUS -S
    Alison

  • How do I increase memory for Lion install?

    When I try to install Lion, I get the following: "Mac OS X 10.7 requires at least 2 GB of memory." Any thoughts about what is going on?

    I bought my iMac in early 2007.  This is info from Hardware Overview:
    Hardware Overview:
      Model Name:          iMac
      Model Identifier:          iMac5,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.16 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          4 MB
      Memory:          1 GB
      Bus Speed:          667 MHz
      Boot ROM Version:          IM51.0090.B09
      SMC Version (system):          1.9f4
      I've looked on Apple Store and I think it's saying that there's no memory currently available for this model.

  • How do I increase memory for Creator 2 IDE?

    Thanks.

    Hi,
    In the domain.xml file located under
    <creartor2 install dir>/ \SunAppServer8\domains\creator\config, search for the following line:
    <jvm-options>-Xmx512m</jvm-options>
    Check for the current value and increase it.
    Hope this helps
    Cheers
    Giri

  • Increase memory for pages

    Can I devote a larger portion of RAM to Pages?
    I tile up a large file with lots of images which slows down after awhile.
    Cheers
    Toby

    Toby,
    Pages is slow. None here will dispute that, but I don't think there is anything to be done with system settings.
    Make sure your photos are as small as possible before entering them in Pages, consistent with your needs. Break your documents up into smaller files if necessary.
    Jerry

  • Issue with memory for java fx 1.3

    Dear all,
    I need your help for an issue.
    I developed a java fx application with version 1.3 and I 've now a big issue...during use memory grows until application crashes...
    Is there a way to release memory during use..i read about problem with java fx release of memory...my application is almost not usable and I can't upgrade it to 2.0.
    Can you give me some help?
    I run it in this way
    javafx -classpath xxxx.jar x2.Main
    is there some option to optimize it? To increase memory for jvm?
    Please help me, after about 30minutes application grows to 500MB of memory and crashes for memory leak...
    Thanks

    Hi,
    About what kind of bounds are you talking about?
    Do you want to accomplish to print out X,Y coordinates of that custom Node/Shape?
    Read this it helped me a lot
    http://weblogs.java.net/blog/2009/07/09/javafx12-understanding-bounds#chase
    http://amyfowlersblog.wordpress.com/2010/04/30/javafx-1-3-taming-the-layout-beast/

  • Increase memory of Integrated WebLogic in Jdev 11.1.2.3 - RedHat 5.8

    Hello:
    I am running Red Hat 5.8 with JDev 11.1.2.3. and I would like to increase the memory of the Integrated WebLogic Server. Here is what I did so far:
    - Installed Jdev 11.1.2.3 on a Red Hat 5.8 - works ok.
    - Created and ran a simple application in Jdev to cause the Integrated WebLogic server to create a default domain. - worked ok
    - I was expecting to find the file setDomainEnv.sh inside the .../Middleware/user_projects/applications/DefaultDomain/bin directory
    But there are no files and no directories under /DefaultDomain folder.
    When using the Integrated WebLogic Server in Jdeveloper, where is the setDomainEnv.sh file?
    For the Integrated WebLogic Server in Jdeveloper, how do I increase Memory for the Integrated WebLogic Server in Jdeveloper?
    Thanks for the help.

    You may want to apply your changes to .../Middleware/wlserver_10.3/common/commonEnv.sh, this will ensure you don't lose settings when you need to recreate your integrated weblogic domain. After you applied changes to this file you should delete your default domain and recreate it (both through JDev). The reason for this is settings from the common folder are applied to domains when they are created, so your existing domain would have been built with the old (default) settings.

  • CodeSecurity in executable jar.............

    AOA
    I have a code security concern for executable jar distribution.
    Any one could unzip the jar and get the classes decompiled.
    So tell me that what are means to secure the code in jar.

    So tell me that what are means to secure the code in jar.Make it a web-based app and never distribute your code.

Maybe you are looking for