# tika
**Repository Path**: apache/tika
## Basic Information
- **Project Name**: tika
- **Description**: Tika 是一个内容抽取的工具集合(a toolkit for text extracting)。它集成了 POI, Pdfbox 并且为文本抽取工作提供了一个统一的界面。
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 36
- **Forks**: 18
- **Created**: 2019-10-22
- **Last Updated**: 2026-08-19
## Categories & Tags
**Categories**: utils
**Tags**: None
## README
# Welcome to Apache Tika
[](http://www.apache.org/licenses/LICENSE-2.0)
[](https://ci-builds.apache.org/job/Tika/job/tika-main-jdk17/)
[](https://ci-builds.apache.org/job/Tika/job/tika-main-jdk17/lastBuild/testReport/)
[](http://search.maven.org/#search|ga|1|g%3A%22org.apache.tika%22)
Apache Tika(TM) is a toolkit for detecting and extracting metadata and structured text content from various documents using existing parser libraries.
Tika is a project of the [Apache Software Foundation](https://www.apache.org).
Apache Tika, Tika, Apache, the Apache feather logo, and the Apache Tika project logo are trademarks of The Apache Software Foundation.
## Quick Start
**Parse a file in Java:**
```java
import org.apache.tika.Tika;
Tika tika = new Tika();
String text = tika.parseToString(new File("document.pdf"));
System.out.println(text);
```
**From the command line** — unzip `tika-app-.zip` into a directory (the zip
has no top-level directory of its own) and run from inside it. The jar is a thin
launcher that loads the parsers from the adjacent `lib/`; on its own it fails with
`NoClassDefFoundError`.
```bash
java -jar tika-app-.jar --text document.pdf
```
**Maven dependency:**
```xml
org.apache.tika
tika-parsers-standard-package
4.x.y
pom
```
## Getting Started
Pre-built binaries of the Apache Tika standalone applications are available from
. Pre-built binaries of all the Tika jars can be
fetched from Maven Central or your favourite Maven mirror.
Tika 2.x and support for Java 8 reached End of Life (EOL) in April 2025. See the
[Tika Roadmap](https://cwiki.apache.org/confluence/display/TIKA/Tika+Roadmap+--+2.x%2C+3.x+and+Beyond)
for the support schedule of each line.
## Building from Source
Tika is based on **Java 17** and uses the [Maven 3](https://maven.apache.org) build system.
The Maven wrapper (`mvnw`) is included in the repository and downloads the correct Maven
version if needed; on Windows, use `mvnw.cmd` instead.
**N.B.** [Docker](https://www.docker.com/products/personal) is used for tests in
tika-integration-tests. If Docker is not installed, those tests are skipped.
Build everything from the main directory:
./mvnw clean install
That produces a runnable `tika-app` you can use to try out Tika features:
java -jar tika-app/target/tika-app-*.jar --help
To build a single project and its dependencies (for example, tika-server-standard):
./mvnw clean install -am -pl :tika-server-standard
If the ossindex-maven-plugin fails the build because a dependency has since been
discovered to have a vulnerability:
./mvnw clean install -Dossindex.skip
### Faster Builds
* **Fast profile** — `-Pfast` skips tests, checkstyle, and spotless.
* **Parallel builds** — `-T1C` builds with one thread per CPU core.
* **[Maven Daemon](https://github.com/apache/maven-mvnd) (`mvnd`)** — keeps a warm JVM
running for 2-3x faster rebuilds and is otherwise a drop-in for `mvn`. On macOS:
`brew install mvndaemon/tap/mvnd`.
Combine them for maximum speed during development:
mvnd clean install -Pfast -T1C
### Building a Specific Tag
To build, say, the 3.0.1 tag:
```bash
git clone https://github.com/apache/tika.git
cd tika
git checkout 3.0.1
./mvnw clean install
```
If a new vulnerability has been discovered between the date of the tag and the date you
are building it, add `-Dossindex.skip`.
If a local test does not work in your environment, please notify the project at
dev@tika.apache.org. As an immediate workaround, you can turn off individual tests:
./mvnw clean install -Dtest=\!UnpackerResourceTest#testPDFImages
### Reproducible Builds
Apache Tika supports [reproducible builds](https://reproducible-builds.org/): building the
same source code with the same JDK version produces byte-for-byte identical artifacts,
regardless of the build machine or time. `project.build.outputTimestamp` is set in
`tika-parent/pom.xml`, and all Maven plugins are configured to produce deterministic output.
To verify the build plan supports reproducibility:
./mvnw artifact:check-buildplan
To verify two builds produce identical artifacts:
./mvnw clean install -DskipTests
mv ~/.m2/repository/org/apache/tika tika-build-1
./mvnw clean install -DskipTests
diff -r tika-build-1 ~/.m2/repository/org/apache/tika
## Maven Dependencies
Apache Tika provides a *Bill of Materials* (BOM) artifact that aligns Tika module versions.
Import it (or Tika's parent pom.xml) in your dependency management section to avoid
convergence errors in your own project.
If you use Apache Maven:
```xml
org.apache.tika
tika-bom
4.x.y
pom
import
org.apache.tika
tika-parsers-standard-package
pom
```
For Gradle:
```kotlin
dependencies {
implementation(platform("org.apache.tika:tika-bom:4.x.y"))
// version not required since bom (platform in Gradle terms)
implementation("org.apache.tika:tika-parsers-standard-package@pom")
}
```
## Migrating to 4.x
Upgrading from 3.x requires code and configuration changes: Java 17, `TikaInputStream` in
the `Parser`/`Detector` SPI, JSON configuration instead of `tika-config.xml`, namespaced
metadata keys, and Markdown as the default output format. Start with
[Migrating to Tika 4.x](docs/modules/ROOT/pages/migration-to-4x/migrating-to-4x.adoc);
tika-server users should also read
[Migrating Tika Server to 4.x](docs/modules/ROOT/pages/migration-to-4x/migrating-tika-server-4x.adoc).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) and .
[](https://github.com/apache/tika/graphs/contributors)
## Mailing Lists
* user@tika.apache.org - About using Tika
* dev@tika.apache.org - About developing Tika
Subscribe by sending a message to `{list}-subscribe@tika.apache.org`.
## Issue Tracker
## Security
See [SECURITY.md](SECURITY.md) and .
## License (see also LICENSE.txt)
Collective work: Copyright 2011 The Apache Software Foundation.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Apache Tika includes a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the licenses listed in the LICENSE.txt file.
## Export Control
This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.
The following provides more details on the included cryptographic software:
Apache Tika uses the Bouncy Castle generic encryption libraries for extracting text content and metadata from encrypted PDF files. See for more details on Bouncy Castle.