2024 Stata Biostatistics and Epidemiology Virtual Symposium · 22 February
Stata provides two ways you can program using the Java platform, Java integration and Java plugins.
Stata 17 and newer introduces Java integration. Java integration is a drop-in environment similar to JShell, where Java code can be executed directly in Stata. This allows Java code to be compiled and executed on-the-fly without an external program. Java integration can be used interactively, in do-files, and in ado-files. See Java integration for details.
Java plugins, introduced in Stata 13, are specialized Java classes that you can call from Stata using the javacall command. Java plugins are suitable for creating large or complex projects and require you to compile and package your Java code in a JAR file. See Java plugins for details.
Whether using Java integration or Java plugins, the Stata Function Interface (sfi) provides a bidirectional connection between Stata and Java. This package has classes to access Stata's current dataset, frames, macros, scalars, matrices, value labels, characteristics, global Mata matrices, date and time values, and more.
See the Stata-Java API for the Stata version you intend to build against and target. Note that the API versions are intended to be forward compatible, but not backward compatible. That is, a feature written using an older Stata-Java API specification may be used with a modern Stata. However, a feature written with a modern Stata-Java API may not be used in an older Stata.
|Stata 18, Stata-Java API Specification
|Stata 17, Stata-Java API Specification
|Stata 16, Stata-Java API Specification
|Stata 15, Stata-Java API Specification
|Stata 14, Stata-Java API Specification
|Stata 13, Stata-Java API Specification
You can read more about how to use Java in Stata in [P] java.
Classroom and web training
Teaching with Stata
Statalist: The Stata Forum
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.