JRun

Creates a general program object on the desktop that create other program objects to launch various java applications.
It provide easy access and aid setup of java applications that otherwise may take time to configure just to start.
The script use the base name of the main .jar/.class file as object id for the program object and set parameters and environment variables for you.

If you have tried a previous version of the script
Delete the existing program object for OpenJDK 6.0 and empty it from the trash can, copy the script over the exsisting and the run it to ensure that a new program object will be created with the new required settings.

Preparation
The script create and maintain
 
 a program object that point to itself that it
→              
              →
associate with files with the extension .jar and .class, that you click on
 to create a program object on the desktop that you can use thereafter. JDownloader Program Object
Some applications can however already be associated with .jar files (such as Zippy and the Archive Tool). Deassociate them as .jar files should be used/started with a Java engine in the first place. You may otherwise have to drag and drop each .jar file onto the program object or right click on the .jar file to create the program object you want.

Overview
  1. Ensure that you have OpenJDK 6/Java 4.1/Java 4.2 unpacked to a folder somewhere on your computer.
  2. Double click on JRun.cmd and wait while it tries to find the Java engine.
    JRun will copy itself to the bin folder.
  3. The script create one program object to run .jar and .class files for the Java engine it first encounter.
     
     or 
     
     for OpenJDK, while 
     
     or 
     
     for Java
  4. It also tries to find NetRexx on your computer to create the program object "NetRexx Compiler / Run".
     
     or 
     
  5. Double click on a .jar/.class file for the application install to create a desktop object for it.
    Double click on .jar/.class file
    You can move and rename the program object but also adjust the parameters once it has been created on the desktop.

    OBS!!     The script attach the .ico/.png file with the same name present in the same folder as the .jar/.class file to the program object.
    JDownloader Program Object(Example of the created program object to launch the java application as seen on the desktop with png support enabled)

    A special note about JDownloader

    You may have to rename the file "JDownloader.jar" from something like "JDownloader.Backup.jar" after updates as their backup/rename procedure seem to end prematurely.

    Advanced 1
  6. Copy the script JRun.cmd with the appropriate .ico/.png images to a secondary Java/OpenJDK bin folder and run the script from there to create alternative program objects for that OpenJDK/Java engine.


    Advanced 2
  7. You can ajdust the parameters of the program object directly by hand but also add custom configuration options to the script.
    Just add the appropriate commented row somewhere in the script JRun.cmd.
    Delete the program object (+ empty the trash can) and recreate it (double click on the .jar/.class file) to test the new/adjusted settings.
    Verify that the new setting has been applied as you open the program object and check the parameters.
    Check custom parameter(s)


Example:
The following parameters let you click on a .java file and send it to Java2Nrx to write a NetRexx version with the extension .nrx, to compile into bytecode and run.
/*<JAV_JAVA2NRX> PARAMETERS=-Xmx512m -Xms32m -jar "%app%" %**P\%**F %**P\%**N.nrx;ASSOCFILTER=*.java*/

Description:
/*
Start of a comment

<JAV_JAVA2NRX>
Object id that has to be modified before creation


PARAMETERS= Section to modify



-Xmx512m -Xms32m -jar "%app%" %**P\%**F %**P\%**N.nrx Set more memory and parameters in wps object




;ASSOCFILTER=*.java Add a new section to associate
.java files with this object





*/
End of comment

WPS Object IDs created with this application
<JAV_JAVA2NRX> Example
<JAV_
Set when it is a .jar file, <CLA_ for a .class file

JAVA2NRX
The name of the .jar file without the extension (.jar)


>
End of wps object name

See help on java for description of parameters such as:
-Xmx512m
-Xms32m
-jar
etc.
                                           

See the function "adapt" in the scipt (JRun.cmd) for parameters such as:
%cls%
%app%
%app_path%


See help in the program object for the description of wps parameters such as:
%**P
%**F
%**N