Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Mirah/SWTSetup"

(New page: To install Mirah and configure it to run with the SWT libraries: *download the latest standalone zip install of Mirah from [http://www.mirah.org http://www.mirah.org]<br> *extract it, s...)
 
 
Line 7: Line 7:
 
*edit the mirah shell script as follows:<br>  
 
*edit the mirah shell script as follows:<br>  
 
*after the line with:<br>MIRAH_CP="$MIRAH_HOME"/lib/mirah-complete.jar<br>add:<br>SWT_CP="$MIRAH_HOME"/lib/swt.jar<br>  
 
*after the line with:<br>MIRAH_CP="$MIRAH_HOME"/lib/mirah-complete.jar<br>add:<br>SWT_CP="$MIRAH_HOME"/lib/swt.jar<br>  
*if on MacOS, define and SWT_OPTS var and add it to the end of JAVA_OPTS, as follows:<br>SWT_OPTS="-XstartOnFirstThread"<br>JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_MEM_MIN $JAVA_STACK $SWT_OPTS"<br>  
+
*add SWT_CP to the runtime classpath, e.g. replace line:<br>"$JAVACMD" $JAVA_OPTS -jar "$MIRAH_CP" run "$@"<br>with:<br>"$JAVACMD" $JAVA_OPTS -jar "$MIRAH_CP" run -c "$SWT_CP" "$@"<br>
 +
*if on MacOS, SWT needs to run on the first thread of the process, so an extra VM arg is needed. Define an SWT_OPTS var and add it to the end of the existing JAVA_OPTS= line, as follows:<br>SWT_OPTS="-XstartOnFirstThread"<br>JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_MEM_MIN $JAVA_STACK $SWT_OPTS"<br>  
 
*make the same edits to the mirahc shell script  
 
*make the same edits to the mirahc shell script  
 
*if on Windows, adapt the above edits to the appropriate command shell syntax in the .bat files  
 
*if on Windows, adapt the above edits to the appropriate command shell syntax in the .bat files  
 
*add Mirah's bin directory to your path, e.g.:<br>export PATH=$PATH:~/mirah/bin  
 
*add Mirah's bin directory to your path, e.g.:<br>export PATH=$PATH:~/mirah/bin  
 
*you should now be able to compile and run the snippets<br>e.g. mirah Snippet1.mirah
 
*you should now be able to compile and run the snippets<br>e.g. mirah Snippet1.mirah

Latest revision as of 23:35, 26 March 2011

To install Mirah and configure it to run with the SWT libraries:

  • download the latest standalone zip install of Mirah from http://www.mirah.org
  • extract it, say to ~/mirah
  • download the 'SWT Binary and Source' zip for the latest release, and for your platform, from http://download.eclipse.org/eclipse/downloads
  • copy the swt.jar to Mirah's lib directory, e.g. ~/mirah/lib
  • edit the mirah shell script as follows:
  • after the line with:
    MIRAH_CP="$MIRAH_HOME"/lib/mirah-complete.jar
    add:
    SWT_CP="$MIRAH_HOME"/lib/swt.jar
  • add SWT_CP to the runtime classpath, e.g. replace line:
    "$JAVACMD" $JAVA_OPTS -jar "$MIRAH_CP" run "$@"
    with:
    "$JAVACMD" $JAVA_OPTS -jar "$MIRAH_CP" run -c "$SWT_CP" "$@"
  • if on MacOS, SWT needs to run on the first thread of the process, so an extra VM arg is needed. Define an SWT_OPTS var and add it to the end of the existing JAVA_OPTS= line, as follows:
    SWT_OPTS="-XstartOnFirstThread"
    JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_MEM_MIN $JAVA_STACK $SWT_OPTS"
  • make the same edits to the mirahc shell script
  • if on Windows, adapt the above edits to the appropriate command shell syntax in the .bat files
  • add Mirah's bin directory to your path, e.g.:
    export PATH=$PATH:~/mirah/bin
  • you should now be able to compile and run the snippets
    e.g. mirah Snippet1.mirah

Copyright © Eclipse Foundation, Inc. All Rights Reserved.