Last updated January 18, 2011 04:57, by qmxme
» JRuby Project Wiki Home Page
JRuby Options
Contents
- 1 Information
- 1.1 Version Info
- 1.2 Help
- 1.3 System Property List
- 1.4 Copyright
- 2 Directory
- 2.1 JRuby Home
- 2.2 Load Path
- 2.3 Current Directory
- 3 Version
- 3.1 Compat Version
- 3.2 Bytecode Version
- 4 Customization
- 4.1 Local Context Model (embed only)
- 4.2 Local Variable Behavior (embed only)
- 4.3 Lazy Variable Retrieval (embed only)
- 4.4 Class Loader (embed only)
- 4.5 Standard Input
- 4.6 Standard Output
- 4.7 Standard Error
- 4.8 Argument List
- 4.9 ObjectSpace
- 4.10 Run In Process
- 4.11 Environment
- 4.12 Script Filename
- 4.13 Load Service Creator
- 4.14 Profile
- 4.15 Class Cache
- 4.16 Record Separator
- 4.17 KCode
- 4.18 Autosplit
- 4.19 Autosplit Pattern
- 4.20 Assume Loop
- 4.21 Assume Printing
- 4.22 Process Line Ends
- 4.23 Line Number (embed only)
- 4.24 Sharing Variable Switch (embed only)
- 4.25 Termination (embed only)
- 4.26 Receiver Object (embed only)
- 5 JIT settings
- 5.1 JIT Threshold
- 5.2 JIT Max
- 5.3 JIT Max Size
- 5.4 JIT Logging
- 5.5 JIT Logging Verbose
- 5.6 JIT Logging Frequency
- 5.7 JIT Compile Exclude
- 5.8 JIT Compile Exclude
- 6 Logging/ Debugging
- 6.1 Benchmark
- 6.2 Debug Flag
- 6.3 Syntax Check
- 6.4 Parser Debug
- 6.5 Bytecode Info
- 6.6 DEBUG_LOAD_SERVICE
- 6.7 DEBUG_LOAD_TIMINGS
- 6.8 DEBUG_LAUNCHING
- 6.9 FULL_TRACE_ENABLED
- 6.10 REFLECTED_HANDLES
- 7 Compiler
- 7.1 Compilation Mode
- 7.2 CHAINED_COMPILE_LINE_COUNT
- 7.3 PEEPHOLE_OPTZ
- 7.4 FASTEST_COMPILE_ENABLED
- 7.5 FASTOPS_COMPILE_ENABLED
- 7.6 FRAMELESS_COMPILE_ENABLED
- 7.7 POSITIONLESS_COMPILE_ENABLED
- 7.8 THREADLESS_COMPILE_ENABLED
- 7.9 FASTCASE_COMPILE_ENABLED
- 7.10 FASTSEND_COMPILE_ENABLED
- 7.11 LAZYHANDLES_COMPILE
- 7.12 INLINE_DYNCALL_ENABLED
- 8 Native Support
- 8.1 Native Enable
- 8.2 Native Verbose
- 8.3 FORK_ENABLED
- 9 Thread pooling
- 9.1 POOLING_ENABLED
- 9.2 POOL_MAX
- 9.3 POOL_MIN
- 9.4 POOL_TTL
Information
Version Info
- scope: per runtime
- description: JRuby/Ruby versions currently supported
- property: none
- default: false
- command line: -v or --version
- embed: ScriptingContainer.getSupportedRubyVersion()
- JSR223: ScriptEngineFactory.getLanguageVersion()
Help
- scope: per runtime
- description: Shows usage and command line options
- property: none
- default: false
- command line: --help
- embed: none
- JSR223: none
System Property List
- scope: per runtime
- description: List all configuration Java properties (pass -J-Dproperty==value)
- property: none
- default: false
- command line: --properties
- embed: none
- JSR223: none
Copyright
- scope: per runtime
- description: Swiching on/off to show the copyright
- property: none
- default: false
- command line: --copyright
- embed: none
- JSR223: none
Directory
JRuby Home
- scope: per runtime
- description: JRuby home directory. The base path to load libraries.
- property: jruby.home=<path to jruby home>
- default: jruby.home system property, java.io.tmp system property or JRUBY_HOME environment variable(embed only)
- command line: none
- embed: ScriptingContainer.get/setHomeDirectory()
- JSR223: System.setProperty("jruby.home", <path to jruby home>)
Load Path
- scope: per runtime
- description: Directory/file paths to load libraries or Ruby files. $LOAD_PATH directory (may be used more than once)
- property: java.class.path or org.jruby.embed.class.path(embed and JSR223)
- default: none
- command line: -Idirectory
- embed: ScriptingContainer.get/setLoadPaths()
- JSR223: System.setProperty("org.jruby.embed.class.path", <path string>)
Current Directory
- scope: per runtime
- description: The current directory to execute scripts. JRuby changes a directory to the specified directory before executing.
- property: user.dir = <path to current directory>
- default: user.dir system property
- command line: -Cdirectory
- embed: ScriptingContainer.get/setLoadPaths()
- JSR223: System.setProperty("user.dir", <path to some directory>)
Version
Compat Version
- scope: per runtime
- description: The major Ruby version to be compatible with
- property: jruby.compat.version==RUBY1_8|RUBY1_9 / org.jruby.embed.compat.version (JSR223)
- default: RUBY1_8
- command line: --1.8|--1.9 or –compat RUBY1_8 | RUBY1_9
- embed: ScriptingContainer.get/setCompatVersion()
- JSR223: System.setProperty("org.jruby.embed.compat.version", ruby1_9)
Bytecode Version
- scope: VM wide
- description: Sets bytecode version for JRuby to generate.
- property: jruby.bytecode.version==1.5|1.6
- default: current JVM version (java.specification.version system property)
- command line: none
- embed: none
- JSR223: none
Customization
Local Context Model (embed only)
- scope: per runtime
- description: Specifies a local context model of Ruby runtime.
- property: org.jruby.embed.localcontext.scope (JSR223)
- default: singleton
- command line: none
- embed: constructor argument of ScriptingContainer
- JSR223: System.setProperty("org.jruby.embed.localcontext.scope", <singleton, singlethread, or threadsafe>)
Local Variable Behavior (embed only)
- scope: per runtime
- description: Specifies a local variable behavior for sharing them between Java and Ruby
- property:org.jruby.embed.localvariable.behavior (JSR223)
- default: transient for ScriptingContainer, global for JSR223
- command line: none
- embed: constructor argument of ScriptingContainer
- JSR223: System.setProperty("org.jruby.embed.localvariable.behavior", <transient, persistent, or global>)
Lazy Variable Retrieval (embed only)
- scope: per runtime
- description: Specifies type of variable retrieval from Ruby runtime to use in Java
- property: org.jruby.embed.laziness (JSR223)
- default: true for ScriptingContainer, false for JSR223
- command line: none
- embed: constructor argument of ScriptingContainer
- JSR223: System.setProperty("org.jruby.embed.laziness", <true or false>)
Class Loader (embed only)
- scope: per runtime
- description: Specifies a classloader to load libraries and Ruby files
- property: org.jruby.embed.classloader (JSR223)
- default: Thread.currentThread().getContextClassLoader()
- command line: none
- embed: ScriptingContainer.get/setClassLoader()
- JSR223: System.setProperty("org.jruby.embed.classloader", <current or none>)
Standard Input
- scope: per runtime
- description: Specifies standard input ($STDIN/$stdin)
- property: none
- default: java.lang.System.in
- command line: none
- embed: ScriptingContainer.get/setInput() or get/setReader()
- JSR223: ScriptContext.get/setReader()
Standard Output
- scope: per runtime
- description: Specifies standard input ($STDOUT/$stdout)
- property: none
- default: java.lang.System.out
- command line: none
- embed: ScriptingContainer.get/setOutput() or get/setWriter()
- JSR223: ScriptContext.get/setWriter()
Standard Error
- scope: per runtime
- description: Specifies standard input ($STDERR/$stderr)
- property: none
- default: java.lang.System.err
- command line: none
- embed: ScriptingContainer.get/setError() or get/setErrorWriter()
- JSR223: ScriptContext.get/setErrorWriter()
Argument List
- scope: per runtime
- description: Specifies a Argument List ($ARGV)
- property: none
- default: empty array
- command line: args
- embed: ScriptingContainer.get/setArgv()
- JSR223: Bindings.put(ScriptEngine.ARGV, <array of args>) or ScriptEngine.put(ScriptEngine.ARGV, <array of args>)
ObjectSpace
- scope: per runtime
- description: Switches the value to run with ObjectSpace enabled/disabled (default; improves performance)
- property: jruby.objectspace.enabled == true | false
- default: false
- command line: -X-O (disable) / -X==O (enable)
- embed: ScriptingContainer.is/setObjectSpaceEnabled()
- JSR223: none
Run In Process
- scope: per runtime
- description: Sets in-process launching of e.g. system('ruby ...').
- property: jruby.launch.inproc == true | false
- default: true
- command line: none
- embed: ScriptingContainer.is/setRunRubyInProcess()
- JSR223: none
Environment
- scope: per runtime
- description: Sets a map of key-value pairs of environment variables
- property: none
- default: empty map
- command line: none
- embed: ScriptingContainer.get/setEnvironment()
- JSR223: none
Script Filename
- scope: per runtime
- description: Sets a script filename to be executed
- property: none
- default: given filename or “<script>” if the filename is not set(embed)
- command line: -S <filename>
- embed: ScriptingContainer.get/seScriptFilename()
- JSR223: ScriptContext.setAttribute(ScriptEngine.FILENAME, <filename>)
Load Service Creator
- scope: per runtime
- description: Specifies a LoadServiceCreator to load LoadService for libraries
- property: none
- default: LoadServiceCreator.DEFAULT
- command line: none
- embed: ScriptingContainer.get/setLoadServiceCreator()
- JSR223: none
Profile
- scope: per runtime
- description: Specifies a restricted subset of code to be loaded during the runtime initialization
- property: none
- default: Profile.DEFAULT
- command line: none
- embed: ScriptingContainer.get/setProfile()
- JSR223: none
Class Cache
- scope: per runtime
- description: Specifies a class cache object
- property: none
- default: ClassCache object with default classloader and jitMax
- command line: none
- embed: ScriptingContainer.get/setClassCache()
- JSR223: none
Record Separator
- scope: per runtime
- description: Specifies record separator (\\0, if no argument)
- property: none
- default: false
- command line: -0[octal]
- embed: ScriptingContainer.get/setRecordSeparator()
- JSR223: none
KCode
- scope: per runtime
- description: specifies code-set (e.g. -Ku for Unicode, -Ke for EUC and -Ks for SJIS)
- property: none
- default: KCode.NONE
- command line: -Kkcode
- embed: ScriptingContainer.get/setKCode()
- JSR223: none
Autosplit
- scope: per runtime
- description: Turns on autosplit mode with -n or -p (splits $_ into $F)
- property: none
- default: false
- command line: -a
- embed: none
- JSR223: none
Autosplit Pattern
- scope: per runtime
- description: Specifies split() pattern for autosplit (-a)
- property: none
- default: false
- command line: -Fpattern
- embed: none
- JSR223: none
Assume Loop
- scope: per runtime
- description: Assumes 'while gets(); ... end' loop around your script
- property: no
- default: false
- command line: -n
- embed: no
Assume Printing
- scope: per runtime
- description: Assumes loop like -n but print line also like sed
- property: none
- default: false
- command line: -p
- embed: none
- JSR223: none
Process Line Ends
- scope: per runtime
- description: Enables line ending processing
- property: none
- default: false
- command line: -l
- embed: none
- JSR223: none
Line Number (embed only)
- scope: per evaluation
- description: Specifies an offset of line numbers show up in error message
- property: org.jruby.embed.linenumber (JSR223)
- default: 0
- command line: none
- embed: argument of ScriptingContainer.parse()
- JSR223: System.setProperty("org.jruby.embed.linenumber", <number>)
Sharing Variable Switch (embed only)
- scope: per evaluation
- description: Set on/off sharing variables feature
- property: org.jruby.embed.sharing.variables (JSR223)
- default: true
- command line: none
- embed: ScirptingContainer.setAttribute(AttributeName.SHARING_VARIABLES, <true or false>)
- JSR223: System.setProperty("org.jruby.embed.sharing.variables", <true or false>)
Termination (embed only)
- scope: per evaluation
- description: Executes termination
- property: org.jruby.embed.termination (JSR223)
- default: off
- command line: none
- embed: ScirptingContainer.terminate()
- JSR223: System.setProperty("org.jruby.embed.termination", <true or false>)
Receiver Object (embed only)
- scope: per evaluation
- description: Specifies a receiver object to get/put/remove variables.
- property: org.jruby.embed.receiver (JSR223)
- default: off
- command line: none
- embed: argument of ScirptingContainer.get()/put()/remove()
- JSR223: System.setProperty("org.jruby.embed.receiver", <receiver object>)
JIT settings
JIT Threshold
- scope: per runtime
- description: Sets JIT threshold to the specified method invocation count.
- property: jruby.jit.threshold == <invocation count>
- default: JIT_THRESHOLD (50)
- command line: none
- embed: ScriptingContainer.get/setJitThreshold()
- JSR223: none
JIT Max
- scope: per runtime
- description: Sets the max count of active methods eligible for JIT-compilation.
- property: jruby.jit.max==<method count>
- default: JIT_MAX_METHODS_LIMIT (4096) per runtime. A value of 0 disables JIT, -1 disables max.
- command line: none
- embed: ScriptingContainer.get/setJitMax()
- JSR223: none
JIT Max Size
- scope: per runtime
- description: Sets the maximum full-class byte size allowed for jitted methods.
- property: jruby.jit.maxsize==<jitted method size (full .class)>
- default: Integer.MAX_VALUE
- command line: none
- embed: ScriptingContainer.get/setJitMaxSize()
- JSR223: none
JIT Logging
- scope: per runtime
- description: Enables JIT logging (reports successful compilation).
- property: jruby.jit.logging == true | false
- default: false
- command line: none
- embed: none
- JSR223: none
JIT Logging Verbose
- scope: per runtime
- description: Enables verbose JIT logging (reports failed compilation).
- property: jruby.jit.logging.verbose==true|false
- default: false
- command line: none
- embed: System.setProperty("jruby.jit.logging.verbose", <true or false>)
- JSR223: System.setProperty("jruby.jit.logging.verbose", <true or false>)
JIT Logging Frequency
- scope: per runtime
- description: Sets an interval to log a message every n methods JIT compiled.
- property: jruby.jit.logEvery==<method count>
- default: 0 (off)
- command line: none
- embed: ScriptingContainer.get/setJitLogEvery()
- JSR223: none
JIT Compile Exclude
- scope: VM wide
- description: Excludes methods from JIT by class/module short name, c/m::method_name, or -::method_name for anon/singleton classes/modules. Comma-delimited.
- property: jruby.jit.exclude==<ClsOrMod,ClsOrMod::method_name,-::method_name>
- default: null
- command line: none
- embed: none
- JSR223: none
JIT Compile Exclude
- scope: VM wide
- description: Caches jitted method in-memory bodies across runtimes and loads.
- property: jruby.jit.cache==true|false
- default: true
- command line: none
- embed: none
- JSR223: none
Logging/ Debugging
Benchmark
- scope: per runtime
- description: benchmark mode, times the script execution
- property: none
- default: false
- command line: -b
- embed: none
- JSR223: none
Debug Flag
- scope: per runtime
- description: Sets debugging flag ($DEBUG)
- property: none
- default: false
- command line: -d or --jdb
- embed: none
- JSR223: none
Syntax Check
- scope: per runtime
- description: Checks syntax only
- property: none
- default: false
- command line: -c
- embed: none
- JSR223: none
Parser Debug
- scope: per runtime
- description: Enables parsing debug output
- property: none
- default: false
- command line: -y
- embed: none
- JSR223: none
Bytecode Info
- scope: per runtime
- description: Switches to show the JVM bytecode produced by compiling specified code
- property: none
- default: false
- command line: --bytecode
- embed: none
- JSR223: none
DEBUG_LOAD_SERVICE
- scope: VM wide
- description: LoadService logging
- property: jruby.debug.loadService==true|false
- default: false
- command line: none
- embed: none
- JSR223: none
DEBUG_LOAD_TIMINGS
- scope: VM wide
- description: Print load timings for each require'd library.
- property: jruby.debug.loadService.timing==true|false
- default: false
- command line: none
- embed: none
- JSR223: none
DEBUG_LAUNCHING
- scope: VM wide
- description: Sets shellLauncher logging.
- property: jruby.debug.launch==true|false
- default: false
- command line: none
- embed: none
- JSR223: none
FULL_TRACE_ENABLED
- scope: VM wide
- description: Sets the execution mode most suitable for debugger functionality, which is whether full traces are enabled (c-call/c-return) or not.
- property: jruby.debug.fullTrace==true|false
- default: false
- command line: --debug
- embed: none
- JSR223: none
REFLECTED_HANDLES
- scope: VM wide
- description: Sets the flag to use reflection for binding methods, not generated bytecode.
- property: jruby.reflected.handles==true|false
- default: false
- command line: none
- embed: none
- JSR223: none
Compiler
Compilation Mode
- scope: per runtime
- description: Sets runtime compilation mode
- property: jruby.compile.mode == JIT | FORCE | OFF / org.jruby.embed.compilemode (JSR223)
- default: OFF(embed), FORCE(--fast option), JIT(otherwise)
- command line: -X-C(off), -X==C(force)
- embed: ScriptingContainer.get/setCompileMode()
- JSR223: System.setProperty("org.jruby.embed.compilemode", <jit or force>)
CHAINED_COMPILE_LINE_COUNT
- scope: VM wide
- description: Sets the number of lines at which compiled bodies are \"chained\".
- property: jruby.compile.chainsize == <line count>
- default: CHAINED_COMPILE_LINE_COUNT_DEFAULT (500)
- command line: none
- embed: none
- JSR223: none
PEEPHOLE_OPTZ
- scope: VM wide
- description: Enables or disables peephole optimizations.
- property: jruby.compile.peephole == true | false
- default: true (on)
- command line: none
- embed: none
- JSR223: none
FASTEST_COMPILE_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL) Turns on all experimental compiler optimizations
- property: jruby.compile.fastest == true | false
- default: false
- command line: --fast
- embed: none
- JSR223: none
FASTOPS_COMPILE_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL) Turn on fast operators for Fixnum.
- property: jruby.compile.fastops == true | false
- default: FASTEST_COMPILE_ENABLED (false)
- command line: --fast
- embed: none
- JSR223: none
FRAMELESS_COMPILE_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL) Turn on frameless compilation where possible
- property: jruby.compile.frameless == true | false
- default: FASTEST_COMPILE_ENABLED (false)
- command line: --fast
- embed: none
- JSR223: none
POSITIONLESS_COMPILE_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL) Turns on compilation that avoids updating Ruby position info.
- property: jruby.compile.positionless == true | false
- default: FASTEST_COMPILE_ENABLED (false)
- command line: --fast
- embed: none
- JSR223: none
THREADLESS_COMPILE_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL) Turns on compilation without polling for \"unsafe\" thread events.
- property: jruby.compile.threadless == true | false
- default: FASTEST_COMPILE_ENABLED (false)
- command line: none
- embed: none
- JSR223: none
FASTCASE_COMPILE_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL) Turn on fast case/when for all-Fixnum whens.
- property: jruby.compile.fastcase == true | false
- default: false
- command line: --fast
- embed: none
- JSR223: none
FASTSEND_COMPILE_ENABLED
- scope: VM wide
- description:
- property: jruby.compile.fastsend == true | false
- default: false
- command line: --fast
- embed: none
- JSR223: none
LAZYHANDLES_COMPILE
- scope: VM wide
- description: Generates method bindings (handles) for compiled methods lazily.
- property: jruby.compile.lazyHandles == true | false
- default: false
- command line: none
- embed: none
- JSR223: none
INLINE_DYNCALL_ENABLED
- scope: VM wide
- description:
- property name: jruby.compile.inlineDyncalls
- default: FASTEST_COMPILE_ENABLED (false)
- command line: --fast
- embed: none
- JSR223: none
Native Support
Native Enable
- scope: VM wide
- description: Enables/disables native extensions (like JNA for non-Java APIs
- property: jruby.native.enabled == true | false
- default: true
- command line: none
- embed: none
- JSR223: none
Native Verbose
- scope: VM wide
- description: Enables verbose logging of native extension loading.
- property: jruby.native.verbose== true | false
- default: false
- command line: none
- embed: none
- JSR223: none
FORK_ENABLED
- scope: VM wide
- description: (EXPERIMENTAL, maybe dangerous) Enables fork(2) on platforms that support it.
- property: jruby.fork.enabled == true | false
- default: false
- command line: none
- embed: none
- JSR223: none
Thread pooling
POOLING_ENABLED
- scope: VM wide
- description: Enables reuse of native backing threads via a thread pool.
- property: jruby.thread.pool.enabled == true | false
- default: false
- command line: none
- embed: none
- JSR223: none
POOL_MAX
- scope: VM wide
- description: Sets the maximum number of threads to allow in the pool.
- property: jruby.thread.pool.max == <max thread count>
- default: Integer.MAX_VALUE
- command line: none
- embed: none
- JSR223: none
POOL_MIN
- scope: VM wide
- description: Sets the minimum number of threads to keep alive in the pool.
- property: jruby.thread.pool.min == <min thread count>
- default: 0
- command line: none
- embed: none
- JSR223: none
POOL_TTL
- scope: VM wide
- description: Sets the maximum number of seconds to keep alive an idle thread.
- property: jruby.thread.pool.ttl == <time to live, in seconds>
- default: 60
- command line: none
- embed: none
- JSR223: none





