scalac
– Compiler for the Scala 2 language
scalac
[ <options> ] <source files>
<options>
<source files>
MyClass.scala
).The compiler has a set of standard options that are supported on the current development environment and will be supported in future releases. An additional set of non-standard options are specific to the current virtual machine implementation and are subject to change in the future. Non-standard options begin with -X.
–g:{none,source,line,vars,notc}
"none"
generates no debugging info,
"source"
generates only the source file attribute,
"line"
generates source and line number information,
"vars"
generates source, line number and local variable information,
"notc"
generates all of the above and will not perform tail call optimization.
–nowarn
–verbose
–deprecation
off
(accepted values are: on
, off
, yes
and no
)
–unchecked
–classpath <path>
"boot"
) search path.
CLASSPATH
variable or using the -classpath
command-line option overrides that default, so if you want to include the current directory in the search path, you must include "."
in the new settings.
–sourcepath <path>
–bootclasspath <path>
scala.List
").–extdirs <dirs>
–d <directory>
–encoding <encoding>
"UTF8"
, Windows: "Cp1252"
). Executing the following code in the Scala interpreter will return the default value on your system:
scala>
new java.io.InputStreamReader(System.in).getEncoding
–target: <target>
jvm-1.5,msil
).
"jvm-1.5"
(was "jvm-1.4"
up to Scala version 2.6.1).
–print
–optimise
–explaintypes
–uniqid
–version
–help
–Xassem <file>
–Xassem-path <path>
–Xcheck-null
–Xdisable-assertions
–Xexperimental
–Xno-uescape
–Xplug-types
–Xplugin: <file>
–Xplugin-disable: <plugin>
–Xplugin-list
–Xplugin-opt: <plugin:opt>
–Xplugin-require: <plugin>
–Xprint: <phases>
–Xprint-pos
–Xprint-types
–Xprompt
–Xresident
–Xshow-class <class>
–Xshow-object <object>
–Xshow-phases
–Xsource-reader <classname>
–Xscript <object>
initial
parse
namer
analyze
refcheck
uncurry
lambdalift
typesasvalues
addaccessors
explicitouterclasses
addconstructors
tailcall
wholeprog
addinterfaces
expandmixins
boxing
erasure
icode
codegen
terminal
all
JAVACMD
java
command to be used for running the Scala code. Arguments may be specified as part of the environment variable; spaces, quotation marks, etc., will be passed directly to the shell for expansion.JAVA_HOME
java
command unless JAVACMD
variable set.JAVA_OPTS
java
command defined by JAVACMD
.
JAVA_OPTS="-Xmx512M -Xms16M -Xss16M"
JAVA_OPTS="--mx512m --ms16m"
scalac
HelloWorld
classes
scalac
–d classes
HelloWorld.scala
java
command
env JAVACMD
=/usr/local/bin/cacao
scalac
–d classes
HelloWorld.scala
src
to the destination directory classes
scalac
–d classes
src/*.scala
scalac
returns a zero exist status if it succeeds to compile the specified input files. Non zero is returned in case of failure.
Written by Martin Odersky and other members of the Scala team.
Report bugs to http://lampsvn.epfl.ch/trac/scala
.
This is open-source software, available to you under a BSD-like license. See accomponying "copyright" or "LICENSE" file for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
fsc(1), sbaz(1), scala(1), scaladoc(1), scalap(1)