Text Based Compiler,
simple tool for checking that Java code written in the form of an
SSCCE is actually compilable!
STBC will run on any computer with a version 1.6+ Java
STBC uses is merely a public interface to the compiler in
tools.jar that is distributed only with
JDKs (though the 'public
of the JDK also seems to acquire a
tools.jar). This leads to
some unusual requirements in running either the native jar, or the web start app.
See help & configuration for more details.
To download (or run) STBC, click the Download STBC button.
Run the Jar using the JRE of a JDK.
Many development environments will already
be correctly set-up to run STBC by 'double clicking' the jar.
If not, it can be configured externally or
To launch STBC using webstart, click the
Launch STBC button.
To work under webstart, STBC requires the JRE of an JDK.
The path can be configured externally or
Download the source and build files by clicking Download Source.
- The thread
Example code for java compiler with a simple GUI
at the Sun forums, for the basic source code (of this relatively simple tool).
Feel free to report bugs or make suggestions on that thread.
- As usual, the Mindprod site has a good overview of
on the fly
compilation, with some examples and many valuable links. This
page is especially worthy of mention since on-the-fly compilation
has been available for a long while, whereas the JavaCompiler
interface was only introduced into the J2SE in Java 6.
- JavaDocs of the
javax.tools package and the classes used in this app.
The docs for
getSystemJavaCompiler() mention that it returns
"the compiler provided with this platform or
null if no compiler is provided",
but do not make clear why it might be
nor the fact that the compiler will not be available to applets or webstart apps.
The public interface to the Java compiler.
A subclass of this allows us to compile source code contained in a
The code of the
JavaSourceFromString is from the JavaDocs for the
Softpedia guarantees that STBC 1.0 is 100% CLEAN, which means it does not contain any form of malware,
including spyware, viruses, trojans and backdoors.