Usage (Command Line)

Vineflower can be run from the command line.

java -jar vineflower.jar [args...] {in}+ [{out}]

Vineflower also accepts arguments to change decompilation behavior.

Arguments

--cfg=file, -cfg=file

A configuration file containing additional arguments to pass to the decompiler, one per line.

--add-external=library, -e=library

Can be specified as many times as necessary to add library inputs to the decompile classpath

The following three options control how decompiled output should be written. If none are specified, the output type will be inferred based on the output. .zip or .jar-ending outputs will be treated as archives, all other values will be treated as a directory, or no output at all will write the decompiled output to the console.

--file

Prefer saving to an archive file.

--folder

Prefer saving to a folder, potentially extracting an input archive.

--legacy-saving

Use legacy Fernflower save behavior.

It is possible to limit decompiled output to only a certain subset of the input files, for cases where an entire archive is provided as input:

--only=prefix, -only=prefix

Only members whose paths start with prefix will be emitted

The following values change the decompilation behavior itself.

--ascii-strings=bool, -asc=bool

Encode non-ASCII characters in string and character literals as Unicode escapes.

Default: 0

--banner=string, -ban=string

A message to display at the top of the decompiled file.

--boolean-as-int=bool, -bto=bool

Represent integers 0 and 1 as booleans.

Default: 1

--bytecode-source-mapping=bool, -bsm=bool

Map Bytecode to source lines.

Default: 0

--decompile-assert=bool, -das=bool

Decompile assert statements.

Default: 1

--decompile-complex-constant-dynamic=bool, -dcc=bool

Some constant-dynamic expressions can’t be converted to a single Java expression with identical run-time behaviour. This decompiles them to a similar non-lazy expression, marked with a comment.

Default: 0

--decompile-enums=bool, -den=bool

Decompile enums.

Default: 1

--decompile-finally=bool, -fdi=bool

Decompile finally blocks.

Default: 1

--decompile-generics=bool, -dgs=bool

Decompile generics in classes, methods, fields, and variables.

Default: 1

--decompile-inner=bool, -din=bool

Process inner classes and add them to the decompiled output.

Default: 1

--decompile-java4=bool, -dc4=bool

Resugar the Java 1-4 class reference format instead of leaving the synthetic code.

Default: 1

--decompile-preview=bool, -dpr=bool

Decompile features marked as preview or incubating in the latest Java versions.

Default: 1

--decompile-switch-expressions=bool, -swe=bool

Decompile switch expressions in modern Java class files.

Default: 1

--decompiler-comments=bool, -dec=bool

Sometimes, odd behavior of the bytecode or unfixable problems occur. This enables or disables the adding of those to the decompiled output.

Default: 1

--dump-bytecode-on-error=bool, -dbe=bool

Put the bytecode in the method body when an error occurs.

Default: 1

--dump-code-lines=bool, -dcl=bool

Dump line mappings to output archive zip entry extra data.

Default: 0

--dump-exception-on-error=bool, -dee=bool

Put the exception message in the method body or source file when an error occurs.

Default: 1

--dump-text-tokens=bool, -dtt=bool

Dump Text Tokens on each class file

Default: 0

--ensure-synchronized-monitors=bool, -esm=bool

If a synchronized block has a monitorenter without any corresponding monitorexit, try to deduce where one should be to ensure the synchronized is correctly decompiled.

Default: 1

--error-message=string, -erm=string

Message to display when an error occurs in the decompiler.

Default: Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)

--explicit-generics=bool, -ega=bool

Put explicit diamond generic arguments on method calls.

Default: 0

--force-jsr-inline=bool, -fji=bool

Forces the processing of JSR instructions even if the class files shouldn’t contain it (Java 7+)

Default: 0

--hide-default-constructor=bool, -hdc=bool

Hide constructors with no parameters and no code.

Default: 1

--hide-empty-super=bool, -hes=bool

Hide super() calls with no parameters.

Default: 1

--ignore-invalid-bytecode=bool, -iib=bool

Ignore bytecode that is malformed.

Default: 0

--include-classpath=bool, -iec=bool

Give the decompiler information about every jar on the classpath.

Default: 0

--include-runtime=string, -jrt=string

Give the decompiler information about the Java runtime, either 1 or current for the current runtime, or a path to another runtime

--incorporate-returns=bool, -ner=bool

Integrate returns better in try-catch blocks instead of storing them in a temporary variable.

Default: 1

--indent-string=string, -ind=string

A string of spaces or tabs that is placed for each indent level.

Default:   

--inline-simple-lambdas=bool, -isl=bool

Remove braces on simple, one line, lambda expressions.

Default: 1

--keep-literals=bool, -lit=bool

Keep NaN, infinities, and pi values as is without resugaring them.

Default: 0

--lambda-to-anonymous-class=bool, -lac=bool

Decompile lambda expressions as anonymous classes.

Default: 0

--log-level=string, -log=string

Logging level. Must be one of: ‘info’, ‘debug’, ‘warn’, ‘error’.

Default: INFO

--mark-corresponding-synthetics, -mcs

Mark lambdas and anonymous and local classes with their respective synthetic constructs

Default: 0

--max-time-per-method=int, -mpm=int

Maximum time in seconds to process a method. This is deprecated, do not use.

Default: 0

--new-line-separator=bool, -nls=bool

Use \n instead of \r\n for new lines. Deprecated, do not use.

Default: 1

--override-annotation=bool, -ovr=bool

Display override annotations for methods known to the decompiler.

Default: 1

--pattern-matching=bool, -pam=bool

Decompile with if and switch pattern matching enabled.

Default: 1

--preferred-line-length=int, -pll=int

Max line length before formatting is applied.

Default: 160

--remove-bridge=bool, -rbr=bool

Removes any methods that are marked as bridge from the decompiled output.

Default: 1

--remove-empty-try-catch=bool, -rer=bool

Remove try-catch blocks with no code.

Default: 1

--remove-getclass=bool, -rgn=bool

Remove synthetic getClass() calls created by code such as ‘obj.new Inner()’.

Default: 1

--remove-imports=bool, -rim=bool

Remove import statements from the decompiled code

Default: 0

--remove-synthetic=bool, -rsy=bool

Removes any methods and fields that are marked as synthetic from the decompiled output.

Default: 1

--rename-members=bool, -ren=bool

Rename classes, fields, and methods with a number suffix to help in deobfuscation.

Default: 0

--show-hidden-statements=bool, -shs=bool

Display hidden code blocks for debugging purposes.

Default: 0

--simplify-stack=bool, -ssp=bool

Simplify variables across stack bounds to resugar complex statements.

Default: 1

--skip-extra-files=bool, -sef=bool

Skip copying non-class files from the input folder or file to the output

Default: 0

--sourcefile-comments=bool, -sfc=bool

Add debug comments showing the class SourceFile attribute if present.

Default: 0

--synthetic-not-set=bool, -nns=bool

Treat some known structures as synthetic even when not explicitly set.

Default: 0

--ternary-constant-simplification=bool, -tcs=bool

Fold branches of ternary expressions that have boolean true and false constants.

Default: 0

--ternary-in-if=bool, -tco=bool

Tries to collapse if statements that have a ternary in their condition.

Default: 1

--thread-count=int, -thr=int

How many threads to use to decompile.

Default: 4

--try-loop-fix=bool, -tlf=bool

Fixes rare cases of malformed decompilation when try blocks are found inside of while loops

Default: 1

--undefined-as-object=bool, -uto=bool

Treat nameless types as java.lang.Object.

Default: 1

--use-lvt-names=bool, -udv=bool

Use LVT names for local variables and parameters instead of var<index>_<version>.

Default: 1

--use-method-parameters=bool, -ump=bool

Use method parameter names, as given in the MethodParameters attribute.

Default: 1

--user-renamer-class=string, -urc=string

Path to a class that implements IIdentifierRenamer.

--verify-anonymous-classes=bool, -vac=bool

Verify that anonymous classes are local.

Default: 0

--verify-merges=bool, -vvm=bool

Tries harder to verify the validity of variable merges. If there are strange variable recompilation issues, this is a good place to start.

Default: 0

--warn-inconsistent-inner-attributes=bool, -win=bool

Warn about inconsistent inner class attributes

Default: 1