Skip to content

JRubyCommandLineParameters

headius edited this page Jan 18, 2011 · 5 revisions

JRuby Command Line Parameters

These JRuby commands are entered in a terminal window or command window, depending on your operating system.

  $ jruby --help
  Usage: jruby [switches] [--] [programfile] [arguments]
    -0[octal]       specify record separator ( , if no argument)
    -a              autosplit mode with -n or -p (splits $_ into $F)
    -b              benchmark mode, times the script execution
    -c              check syntax only
    -Cdirectory     cd to directory, before executing your script
    -d              set debugging flags (set $DEBUG to true)
    -e 'command'    one line of script. Several -e's allowed. Omit [programfile]
    -Fpattern       split() pattern for autosplit (-a)
    -i[extension]   edit ARGV files in place (make backup if extension supplied)
    -Idirectory     specify $LOAD_PATH directory (may be used more than once)
    -J[java option] pass an option on to the JVM (e.g. -J-Xmx512m)
                      use --properties to list JRuby properties
                      run 'java -help' for a list of other Java options
    -Kkcode         specifies code-set (e.g. -Ku for Unicode
    -l              enable line ending processing
    -n              assume 'while gets(); ... end' loop around your script
    -p              assume loop like -n but print line also like sed
    -rlibrary       require the library, before executing your script
    -s              enable some switch parsing for switches after script name
    -S              look for the script in bin or using PATH environment variable
    -T[level]       turn on tainting checks
    -v              print version number, then turn on verbose mode
    -w              turn warnings on for your script
    -W[level]       set warning level; 0=silence, 1=medium, 2=verbose (default)
    -X[option]      enable extended option (omit option to list)
    -y              enable parsing debug output
    --copyright     print the copyright
    --debug         sets the execution mode most suitable for debugger functionality
    --jdb           runs JRuby process under JDB
    --properties    List all configuration Java properties (pass -J-Dproperty=value)
    --sample        run with profiling using the JVM's sampling profiler
    --client        use the non-optimizing "client" JVM (improves startup; default)
    --server        use the optimizing "server" JVM (improves perf)
    --manage        enable remote JMX management and monitoring of the VM and JRuby
    --headless      do not launch a GUI window, no matter what
    --1.8           specify Ruby 1.8.x compatibility (default)
    --1.9           specify Ruby 1.9.x compatibility
    --bytecode      show the JVM bytecode produced by compiling specified code
    --version       print the version
Clone this wiki locally