Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.crosswire:jsword:2.1'
}
dependencies {
implementation("com.github.crosswire:jsword:2.1")
}
<dependency>
<groupId>com.github.crosswire</groupId>
<artifactId>jsword</artifactId>
<version>2.1</version>
</dependency>
libraryDependencies += "com.github.crosswire" % "jsword" % "2.1"
:dependencies [[com.github.crosswire/jsword "2.1"]]
JSword is a Java library for Bible study software, providing a rich API for accessing, searching, and displaying biblical texts and related resources. It is the engine behind a variety of Bible study applications, offering a flexible and extensible platform for developers and users alike.
JSword aims to make the Bible and related texts freely available in a wide range of languages and translations. It supports a variety of modern and ancient Bible versions, commentaries, dictionaries, daily devotionals, and other resources.
JSword powers several open-source projects, including BibleDesktop and And Bible. The library is designed for cross-platform use and can be integrated into both desktop and mobile applications.
git clone https://github.com/crosswire/jsword.git
cd jsword
./gradlew build
You can include JSword as a dependency via JitPack:
Gradle:
implementation 'com.github.crosswire:jsword:master-SNAPSHOT'
Or replace master-SNAPSHOT
with a tagged release version.
import org.crosswire.jsword.book.*;
import org.crosswire.jsword.passage.*;
import org.crosswire.jsword.versification.*;
Book bible = Books.installed().getBook("KJV");
Key key = bible.getKey("John 3:16");
BookData data = new BookData(bible, key);
String text = OSISUtil.getCanonicalText(data.getOsisFragment());
System.out.println(text);
JSword uses Gradle as its build tool. This makes it easy to open and build the project in all modern Java IDEs.
Follow the instructions below for your preferred environment:
build.gradle
file.build.gradle
file and prompt you to import the Gradle project.Note:
There is no need to generate or commit IDE-specific files (such as .project
, .classpath
, .settings/
, .idea/
, or .vscode/
). All required project structure and dependencies are managed by Gradle.
For command-line builds, use:
./gradlew build
or on Windows:
gradlew.bat build
We welcome contributions! See our Contributing Guide for more information.
JSword supports multiple languages for both interface and content. Community-provided translations—especially of Bible book names (BibleNames)—are maintained through Transifex.
We welcome contributions to our translations!
If you would like to help translate Bible book names or other strings:
Translations are integrated regularly to keep JSword multilingual.
JSword is released under the LGPL 2.1 or later License.
JSword is part of the CrossWire Bible Society family of open-source Bible software. Many thanks to all contributors and the wider community!
For more information, visit the JSword Project Page.