Create Java libraries for Stata
Leverage Java's extensive features
Access third-party Java libraries or write your own code
Custom class loader allows classes to be reloaded during development
Suitable for large and complex projects
Stata Function Interface (sfi) Java package
Bidirectional connection between Stata and Java
Access Stata dataset, frames, macros, scalars, matrices, value labels, characteristics, global Mata matrices, date and time values, and more from Java
Java plugins are specialized Java classes that you can call from Stata. Java plugins are suitable for creating large or complex projects. A plugin can be wrapped up in an ado program and therefore look like any other Stata program when called. For example, you could write a Stata command in Java to pull data from the Federal Reserve Economic Data (FRED). We did, it's the import fred command.
Additionally, the Stata Function Interface (sfi) Java package is included, providing a bidirectional connection between Stata and Java. The sfi 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.
Stata bundles the Java Development Kit (JDK) with its installation, so there is no additional setup involved. This version of Stata includes OpenJDK 17, which is the current long-term support (LTS) version.
Did you know that Java code can be embedded directly in do-files, ado-files, or called interactively too. If that sounds interesting, see Java integration.