jikes(1)

πŸ“¦ version 1.22, in opensuse-leap 16.0

🌸 jikes(1) β€” the java source to bytecode compiler, bestie edition 🌸

okay so welcome to jikes(1), the manual page for jikes β€” and yes, she's a java source to bytecode compiler, which sounds intimidating but honestly she's just out here translating your lil' human-readable Java into bytecode so the machine can vibe with it. πŸ’…


✨ NAME ✨

jikes β€” java source to bytecode compiler πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

jikes [-options] [+options] [@files]
      file.java...

so the shape of it is: you got -options, you got +options, you got @files, and then the actual file.java... files you want compiled. no cap, that's the whole vibe. ✨


πŸ’– DESCRIPTION πŸ’–

Jikes translates Java(TM) source files to bytecode. 🫢 that's the whole job, and she does it well.

the flex list, aka the features β€” she's got:

  • strict adherence to the language specification πŸ‘‘ (she does not play fast and loose with the spec, ever)
  • automatic makefile generation
  • incremental compilation

she's maintained by the Jikes Project. πŸ’œ

now for the housekeeping rules, and bestie you gotta read these because they will absolutely trip you up if you skip them:

  • at this time, jikes only recognizes the full name of options. so you can't abbreviate them, and you can't group them. no shortcuts, sorry 😭 β€” spell it all the way out.
  • you can give different argument types in any order. options, @files, filenames, mix 'em up, she doesn't care. 🌈
  • options are global, so they affect compilation of files listed earlier on the command line too. like, the files you already typed. yes, those. it's giving "main character energy affects the whole timeline."
  • duplicated options override the previous one, unless otherwise listed. last one wins, periodt.
  • if an option is listed in the form +T=n, it can also be specified as +T n or even +Tn. so all three of those are the same thing β€” pick whichever feels cute. πŸŽ€
πŸ’€ real talk though: don't go repeating individual options for funsies. the original says individual options should not be repeated unless noted below β€” so like, don't do it just to see what happens.

(stay tuned, there's more β€” options, examples, all of it. don't go anywhere πŸ’–)

✨ OPTIONS ✨

okay bestie, this is the big one πŸ’… jikes has a LOT of flags. literally a whole closet full of them. here's every single one, no skips, no cap:

  • -bootclasspath path, --bootclasspath path β€” use path for the bootclasspath. this one gets searched first for library class files, and it's usually pointed at java/lib/classes.zip or java/jre/lib/rt.jar. default is an empty path 🫢
  • -classpath path, -cp path, --classpath path β€” use path for CLASSPATH. this path gets searched for both user source and compiled class files. defaults to the current directory ✨
  • -d directory, --target-directory directory β€” write class files into the directory you name. ⚠️ heads up: that directory is NOT in your classpath unless you also list it there. defaults to the current directory.
  • -debug β€” no effect at all, it's just recognized for compatibility. it's giving "i'm here but i'm not doing anything" πŸ’€
  • -depend, --depend, -Xdepend β€” recompile all used classes.
  • -deprecation, --deprecation β€” report when deprecated features get used.
  • -encoding encoding, --encoding encoding β€” use the specified encoding to read source files. πŸŽ€ but plot twist: this one is not available in some builds, because it needs a working iconv or ICU encoder. binary distributions for some platforms (like Windows) do NOT include support for the encoding option, since there's not an adequate transcoding library available on all platforms by default. you can check whether your binary has encoding support by running jikes --help and looking for the --encoding option β€” if it's not listed, then this binary does NOT include support for encoding. defaults to a platform-dependent encoding (like ASCII).
  • -extdirs path, --extdirs path β€” use path for extensions directories. typically set to grab jar and zip extension files located in java/jre/lib/ext. defaults to an empty path.
  • -g β€” exactly the same as -gsource,lines,vars. all the debug info, periodt.
  • -gnone|{source,lines,vars} β€” pick which of the three classfile debug options should be on. if you don't say anything, the default is source,lines. here's the tea: source stores the filename of the source file in the class file, lines adds line number tracking to tie bytecodes to where they live in the source file, and vars adds a table in the class file storing the names of local variables and parameters plus their scope. so the default is line + source info, but not vars. πŸ¦‹
  • -help, --help, -h, -? β€” prints a helpful summary of options, then exits. it overrides all other options, and nothing gets compiled. it's the main character of flags honestly πŸ‘‘
  • -J... β€” no effect, because jikes is native code and doesn't need a Virtual Machine. ignored for compatibility πŸ’€
  • -nowarn, --nowarn, -q β€” don't issue warning messages. want finer control over warnings and cautions? see the +Z option.
  • -nowrite, --nowrite β€” don't write any class files, but list which ones would be written if you use it together with -verbose. dry-run vibes πŸ™ˆ
  • -O, --optimize β€” optimize the bytecode. technically this means jikes should inline private and final methods where appropriate, but currently it does nothing. it's giving "i promise i'll change" 😭
  • -source release, --source release β€” say which Java SDK release the source syntax obeys. for example, to treat the assert keyword as a normal identifier, you can use -source 1.3. setting a lower target results in backward compatibility compilation of old source files. valid releases are 1.3 (Java Language Specification, 2nd edition) and 1.4 (addition of the assert statement, JSR 41). plans are underway to eventually support 1.5 (addition of generics: JSR 14; autoboxing, enhanced for-loop, static import, enums, and varargs: JSR 201; metadata: JSR 175; and updated .class file format: JSR 202; ultimately the Java Language Specification, 3rd edition). if not specified, it defaults to the valid value closest to whatever was specified or defaulted for -target (typically 1.4). ⭐
  • -sourcepath path, --sourcepath path β€” use path to specify user "source only" directories. class files in this path are ignored unless they're listed in other paths. defaults to the empty path.
  • -target release, --target release β€” say which Java SDK release the bytecode should target. for example, exception chaining was introduced in the 1.4 release, so a failed class literal can chain the NoClassDefFoundError to its original ClassNotFoundException; whereas the behavior in the 1.3 release simply discards the original exception. to get the old behavior, you can use -target 1.3. setting a lower target gives forward compatibility to older virtual machines, and some source constructs get compiled to less efficient workarounds in order to avoid known virtual machine bugs or deficiencies. however, a lower target may occasionally produce incorrect semantic behavior πŸ”₯. furthermore, some language features require virtual machine support where there are no known workarounds in earlier releases: the assert statement requires 1.4 (unless you also use -noassert), and the planned addition of typesafe enumerations will require 1.5. the planned addition of type parameterization (also known as generics) will work with 1.1. valid releases are 1.1, 1.2, 1.3, 1.4, and 1.4.2; plans are underway to support 1.5. if not specified, it defaults to the value specified for -source, and if that isn't specified either, it defaults to 1.4.2. πŸ’œ
  • -verbose, --verbose, -v β€” list files read and written. also super useful with -nowrite for a dry run to track dependencies πŸ‘€
  • -version, --version, -V β€” print a version message plus contact information, then exit. overrides all other options except --help, and nothing gets compiled.
  • -Werror β€” exactly the same as +Z2, provided for javac compatibility.
  • -Xstdout β€” write error messages to standard output, not stderr. at the moment this is incompatible with javac, which takes an argument as the name of the file where it will direct compiler message output. πŸ™ƒ
  • -Xswitchcheck β€” synonym for +Pswitchcheck. warns about fallthrough switch cases.
  • ++, --incremental β€” compile in incremental mode. in this mode jikes stays resident, and every keypress of Enter triggers a recompilation of every source file that got rendered out-of-date by file modifications since the last compilation phase. to exit this mode, type q then Enter. it's literally sitting there waiting for you 🧚
  • +a, --noassert β€” don't emit assert statements. ⚠️ this option is not recommended for disabling asserts, because asserts are compiled to have minimal overhead when disabled through the virtual machine. rather, it's intended for reducing classfile size, and to allow the use of -target 1.3 or earlier virtual machine targets that don't support the assert statement.
  • +B, --nobytecode β€” don't invoke the bytecode generator. perform semantic checks only.
  • +D, --dump-errors β€” report errors immediately in emacs-form without buffering.
  • +DR=filename β€” write a report of dependencies to the specified file.
  • +E, --emacs β€” list errors in emacs-form.
  • +F, --full-dependence β€” do a full dependence check except for Zip and Jar files.
  • +Kname=TypeKeyWord β€” map name to TypeKeyWord. you need multiple options to change more than one type keyword.
  • +M, --makefile β€” generate makefile dependencies.
  • +OLDCSO β€” select to use the same classpath search order as in older versions of jikes (for compatibility).
  • +P[group-name] β€” pedantic compilation, aka it issues lots of warnings 🌈. with no group name, this turns on a default set of pedantic warnings that doesn't correspond to any of the named groups. specifying a group name turns that particular named group of warnings on or off, depending on whether the no- prefix is there. some named groups are enabled by default β€” those are marked as such in the output of jikes --help. right now the recognized group names are:
    • effective-java β€” warns about the anti-patterns mentioned in Joshua Bloch's book "Effective Java"
    • modifier-order β€” warns about the recommended ordering of multiple modifiers
    • redundant-modifiers β€” warns about explicitly mentioning an implied modifier
    • serial β€” warns about serializable classes without serialVersionUID fields
    • shadow β€” warns about shadowing and hiding of fields
    • switchcheck β€” warns about fallthrough between cases of switch statements
    • naming-convention β€” warns about names that violate Java naming conventions
    • unused-type-imports β€” warns about unused single-type import statements
    • unused-package-imports β€” warns about unused package import statements

in addition, the pseudo-group all stands for all named groups of warnings, but not the anonymous group controlled by +P. multiple +P options are cumulative in effect. for example, to get all pedantic warnings except modifier ordering, use +P +Pall +Pno-modifier-order. to get just warnings about redundant modifiers without other pedantic warnings, use +Predundant-modifiers. πŸ’–

  • --pedantic β€” synonym for +P, but it doesn't accept flags.
  • +T=n, --tab=n β€” set the value of a tab to n spaces. if not specified, the default is 8.
  • +U, --unzip-dependence β€” do a full dependence check including Zip and Jar files.
  • +Z0 β€” don't issue warning messages.
  • +Z1 β€” treat cautions as errors.
  • +Z2 β€” treat both warnings and cautions as errors.
  • +Z, --zero-cautions β€” same as +Z1, for compatibility with earlier versions of jikes.

oh and one more thing bestie πŸŽ€ β€” an argument can have the form @file, which names a file holding additional command-line arguments. each line in that file is treated as an argument, except that lines beginning with @ are not expanded recursively. lines may optionally be quoted using either single or double quotes. and psst: there are no escape characters β€” '\' is not treated as special. iykyk πŸ¦‹

πŸ—‚οΈ FILES πŸ—‚οΈ

Okay so bestie, real talk: Jikes has a whole little ✨situation✨ going on with classpath searching, and you need to know about it.

The -bootclasspath, -extdirs, and -sourcepath options work exactly the same as they do in javac. No glow-up, no plot twist, same behavior.

And it's not just command line, babes β€” you can also set these with the environment variables BOOTCLASSPATH, EXTDIRS, and SOURCEPATH, which specify the values for those options respectively. πŸ’…

Jikes also has the -classpath option, just like javac, with its matching environment variable CLASSPATH. And on top of that, the classpath can also be specified in the environment variable JIKESPATH β€” although, ngl, that use is discouraged. πŸ™ˆ

So what happens if JIKESPATH and CLASSPATH coexist? Preference goes to JIKESPATH. Periodt. πŸ‘‘

And the hierarchy is real: a value specified on the command line will always be given preference over the value of any environment variable. Main character energy only. ⭐

One thing you cannot skip: all the directories and files specified in these options or environment variables must be in the platform path format β€” usually a colon-separated list, e.g., ".:$HOME/java/jre/lib/rt.jar". Get that format wrong and it's giving πŸ’€.

πŸ‘€ SEE ALSO πŸ‘€

  • The Jikes Project homepage at http://ibm.com/developerworks/opensource/jikes/ β€” for news of recent developments, to download new versions, to report bugs, or to learn how to participate in the development process. Go be a part of history, bestie 🫢

Copyright Β© 1996-2003, 2004 IBM Corporation and others. All Rights Reserved.

Jikes is licensed under the IBM Public License, included in the file license.htm distributed with the program, and also available at the Jikes Project URL. Portions of Jikes are derived from prior, freely distributable projects. For more details on this code, see the comments in src/double.h, src/platform.h, and src/unzip.h. πŸŽ€


πŸ“ NOTES πŸ“

Java is a registered trademark of Sun Microsystems, Inc. That's just facts, no cap. πŸ¦‹


And that's the whole thing, bestie β€” every last crumb of the jikes(1) page (the source/version line and date live down in the footer, doing their little cameo as jikes(1) at the bottom πŸ’–). You ate that. Go compile something iconic. πŸ’…βœ¨

πŸ“¦ where this page comes from