Perforce's P4Java is a Java-native API for accessing Perforce's SCM services in a Java-natural and Java-native way.

P4Java presents Perforce services and Perforce-managed resources and files as first-class Java interfaces, classes, methods, and objects, rather than as simple strings or command-line-like functions. This approach reduces the impedance mismatch between Java and Perforce, and makes it easier to integrate the API into Java applications and tools; it is particularly useful for integrating into model-view-controller (MVC) contexts and workflows.

P4Java is aimed mostly at the following types of Java development:

- Standalone applications that need to access Perforce services from within the application;
- Plug-ins for Java tools such as Eclipse, ant, cruise control, etc., that need to communicate with one or more Perforce servers; and,
- J2EE apps, where P4Java can be embedded within a servlet and / or presented as a web service or (e.g.) an Ajax binding for client-side use.

P4Java is aimed at JDK 6 and later environments, but will work with some limitations against a JDK 5 installation (see the related P4Java User Guide for details)..

## Related Documentation

- The P4Java User Guide (available as a PDF within the main P4Java distribution zip file) — contains a less-formal overview and guide to using P4Java.