#3 Support System Properties

closed
None
2
2005-03-04
2005-02-03
No

When starting an application you could provide sys props
java -jar MyFatJar.jar -Dkey=value

When using OneJar you´re using a starter class. This
class could set these values.

Discussion

  • Ferenc Hechler

    Ferenc Hechler - 2005-02-03

    Logged In: YES
    user_id=876063

    Hello Jan,

    I am not sure about the advantages of setting properties
    programmatically.
    The Properties can also be set before the -jar option:

    java -Dkey=value -jar MyFatJar.jar

    So why should there be another stub doing some args-parsing?

    Best regards,

    feri

     
  • Jan Matèrne

    Jan Matèrne - 2005-02-08

    Logged In: YES
    user_id=573640

    Maybe the JAR is not startable if a sysprop is not set (e.g.
    path to SWT-dll), therefore it has to be started via shell.

    Of course you could use the values defined in a run
    configuration :-)

    And - its up to the developer to define these settings ...

     
  • Ferenc Hechler

    Ferenc Hechler - 2005-03-01

    Logged In: YES
    user_id=876063

    Setting the system-property for the SWT.dll at runtime
    (java.library.path) will not work, because the VM needs this
    information.

    When using One-Jar, there is a boot-loader which is executed
    prior to the main-class, but it only installs an own
    Class-Loader, it does not start a new VM. So it is to late
    to pass any parameters to the VM.

    Do you still think there is a need for this feature?

    I dont think it should always be active.
    Perhaps some application await a parameter like "-Dxyz" and
    it should not be preprocessed and omitted by the boot-loader.

    I have lowerd the priority to low, this feature will be
    interesting together with "Analyse Run Configurations",
    where the args can be taken from the launch-configuration.
    I think about special entries in the Manifest.mf like
    "application-args: -Dxyz=abc ./test.txt" which are then
    provided as args for the main methode.

     
  • Ferenc Hechler

    Ferenc Hechler - 2005-03-01
    • priority: 5 --> 2
    • assigned_to: nobody --> ferenc_hechler
    • status: open --> pending
     
  • Jan Matèrne

    Jan Matèrne - 2005-03-02
    • status: pending --> open
     
  • Jan Matèrne

    Jan Matèrne - 2005-03-02

    Logged In: YES
    user_id=573640

    Ok, the java.library.path is a special case, but you could
    set any other props. But - of course - it would be a nice
    feature in combination with my other RFE.

    And as every RFE - its up to you to priorize that :-)

     
  • Ferenc Hechler

    Ferenc Hechler - 2005-03-04
    • status: open --> closed
     
  • Ferenc Hechler

    Ferenc Hechler - 2005-03-04

    Logged In: YES
    user_id=876063

    The feature will be integrated in one of the next releases.

    There will be a check-box "parse System-Properties from
    command line". The check box can only be activated, if the
    manifest file is generated by the plug-in.

    If the check box is checked the line "FJParse-SysProps:
    true" will be added to the generated manifest file. Also the
    entry "Main-Class" will be changed to
    "net.sf.fjep.bootstrap.BootStrapLoader" and a new entry
    "FJMain-Class" contains the originaly set mainclass.

    If FJParse-SysProps is set to true all comman-lines matching
    "-D<key>=<value>" will be interpreted and filtered out.

    Best regards,

    feri