Skip to content

Commit 986e638

Browse files
committed
Replace legacy Java client instructions by deprecation notice
1 parent bafc0b5 commit 986e638

2 files changed

Lines changed: 92 additions & 90 deletions

File tree

tensorflow/java/LEGACY.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
## Quickstart
2+
3+
- Refer to [Installing TensorFlow for Java](https://www.tensorflow.org/install/lang_java)
4+
- [Javadoc](https://www.tensorflow.org/api_docs/java/reference/org/tensorflow/package-summary)
5+
- [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.tensorflow/tensorflow/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.tensorflow/tensorflow)
6+
7+
## Nightly builds
8+
9+
Releases built from release branches are available on Maven Central.
10+
Additionally, every day binaries are built from the `master` branch on GitHub:
11+
12+
- [JAR](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow.jar)
13+
- [Source JAR](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow-src.jar)
14+
- JNI:
15+
- [Linux CPU-only](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow_jni-cpu-linux-x86_64.tar.gz)
16+
- [Linux GPU](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow_jni-gpu-linux-x86_64.tar.gz)
17+
- [MacOS](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow_jni-cpu-darwin-x86_64.tar.gz)
18+
- Windows: (No nightly builds available yet)
19+
20+
## Building from source
21+
22+
If the quickstart instructions above do not work out, the TensorFlow Java and
23+
native libraries will need to be built from source.
24+
25+
1. Install [bazel](https://www.bazel.build/versions/master/docs/install.html)
26+
27+
2. Setup the environment to build TensorFlow from source code
28+
([Linux or macOS](https://www.tensorflow.org/install/source)).
29+
If you'd like to skip reading those details and do not care about GPU
30+
support, try the following:
31+
32+
```sh
33+
# On Linux
34+
sudo apt-get install python swig python-numpy
35+
36+
# On Mac OS X with homebrew
37+
brew install swig
38+
```
39+
40+
3. [Configure](https://www.tensorflow.org/install/source)
41+
(e.g., enable GPU support) and build:
42+
43+
```sh
44+
./configure
45+
bazel build --config opt \
46+
//tensorflow/java:tensorflow \
47+
//tensorflow/java:libtensorflow_jni
48+
```
49+
50+
The command above will produce two files in the `bazel-bin/tensorflow/java`
51+
directory:
52+
53+
* An archive of Java classes: `libtensorflow.jar`
54+
* A native library: `libtensorflow_jni.so` on Linux, `libtensorflow_jni.dylib`
55+
on OS X, or `tensorflow_jni.dll` on Windows.
56+
57+
To compile Java code that uses the TensorFlow Java API, include
58+
`libtensorflow.jar` in the classpath. For example:
59+
60+
```sh
61+
javac -cp bazel-bin/tensorflow/java/libtensorflow.jar ...
62+
```
63+
64+
To execute the compiled program, include `libtensorflow.jar` in the classpath
65+
and the native library in the library path. For example:
66+
67+
```sh
68+
java -cp bazel-bin/tensorflow/java/libtensorflow.jar \
69+
-Djava.library.path=bazel-bin/tensorflow/java \
70+
...
71+
```
72+
73+
Installation on Windows requires the more experimental [bazel on
74+
Windows](https://bazel.build/versions/master/docs/windows.html). Details are
75+
omitted here, but find inspiration in the script used for building the release
76+
archive:
77+
[`tensorflow/tools/ci_build/windows/libtensorflow_cpu.sh`](https://www.tensorflow.org/code/tensorflow/tools/ci_build/windows/libtensorflow_cpu.sh).
78+
79+
### Bazel
80+
81+
If your project uses bazel for builds, add a dependency on
82+
`//tensorflow/java:tensorflow` to the `java_binary` or `java_library` rule. For
83+
example:
84+
85+
```sh
86+
bazel run -c opt //tensorflow/java/src/main/java/org/tensorflow/examples:label_image
87+
```

tensorflow/java/README.md

Lines changed: 5 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,9 @@
11
# TensorFlow for Java
22

3-
> *WARNING*: The TensorFlow Java API is not currently covered by the TensorFlow
4-
> [API stability guarantees](https://www.tensorflow.org/guide/version_compat).
3+
> *WARNING*: This version of the Java client is deprecated and has been replaced by a new version that is maintained
4+
> in its own [repository](https://github.com/tensorflow/java) under the TensorFlow organization.
55
>
6-
> For using TensorFlow on Android refer instead to [TensorFlow Lite](https://www.tensorflow.org/code/tensorflow/lite/).
6+
> For using TensorFlow on a JVM, please refer to new [TensorFlow Java](https://www.tensorflow.org/jvm/install).
7+
> For using TensorFlow on Android, refer instead to [TensorFlow Lite](https://www.tensorflow.org/code/tensorflow/lite/).
78
8-
## Quickstart
9-
10-
- Refer to [Installing TensorFlow for Java](https://www.tensorflow.org/install/lang_java)
11-
- [Javadoc](https://www.tensorflow.org/api_docs/java/reference/org/tensorflow/package-summary)
12-
- [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.tensorflow/tensorflow/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.tensorflow/tensorflow)
13-
14-
## Nightly builds
15-
16-
Releases built from release branches are available on Maven Central.
17-
Additionally, every day binaries are built from the `master` branch on GitHub:
18-
19-
- [JAR](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow.jar)
20-
- [Source JAR](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow-src.jar)
21-
- JNI:
22-
- [Linux CPU-only](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow_jni-cpu-linux-x86_64.tar.gz)
23-
- [Linux GPU](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow_jni-gpu-linux-x86_64.tar.gz)
24-
- [MacOS](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/lib_package/libtensorflow_jni-cpu-darwin-x86_64.tar.gz)
25-
- Windows: (No nightly builds available yet)
26-
27-
## Building from source
28-
29-
If the quickstart instructions above do not work out, the TensorFlow Java and
30-
native libraries will need to be built from source.
31-
32-
1. Install [bazel](https://www.bazel.build/versions/master/docs/install.html)
33-
34-
2. Setup the environment to build TensorFlow from source code
35-
([Linux or macOS](https://www.tensorflow.org/install/source)).
36-
If you'd like to skip reading those details and do not care about GPU
37-
support, try the following:
38-
39-
```sh
40-
# On Linux
41-
sudo apt-get install python swig python-numpy
42-
43-
# On Mac OS X with homebrew
44-
brew install swig
45-
```
46-
47-
3. [Configure](https://www.tensorflow.org/install/source)
48-
(e.g., enable GPU support) and build:
49-
50-
```sh
51-
./configure
52-
bazel build --config opt \
53-
//tensorflow/java:tensorflow \
54-
//tensorflow/java:libtensorflow_jni
55-
```
56-
57-
The command above will produce two files in the `bazel-bin/tensorflow/java`
58-
directory:
59-
60-
* An archive of Java classes: `libtensorflow.jar`
61-
* A native library: `libtensorflow_jni.so` on Linux, `libtensorflow_jni.dylib`
62-
on OS X, or `tensorflow_jni.dll` on Windows.
63-
64-
To compile Java code that uses the TensorFlow Java API, include
65-
`libtensorflow.jar` in the classpath. For example:
66-
67-
```sh
68-
javac -cp bazel-bin/tensorflow/java/libtensorflow.jar ...
69-
```
70-
71-
To execute the compiled program, include `libtensorflow.jar` in the classpath
72-
and the native library in the library path. For example:
73-
74-
```sh
75-
java -cp bazel-bin/tensorflow/java/libtensorflow.jar \
76-
-Djava.library.path=bazel-bin/tensorflow/java \
77-
...
78-
```
79-
80-
Installation on Windows requires the more experimental [bazel on
81-
Windows](https://bazel.build/versions/master/docs/windows.html). Details are
82-
omitted here, but find inspiration in the script used for building the release
83-
archive:
84-
[`tensorflow/tools/ci_build/windows/libtensorflow_cpu.sh`](https://www.tensorflow.org/code/tensorflow/tools/ci_build/windows/libtensorflow_cpu.sh).
85-
86-
### Bazel
87-
88-
If your project uses bazel for builds, add a dependency on
89-
`//tensorflow/java:tensorflow` to the `java_binary` or `java_library` rule. For
90-
example:
91-
92-
```sh
93-
bazel run -c opt //tensorflow/java/src/main/java/org/tensorflow/examples:label_image
94-
```
9+
Follow this [link](LEGACY.md) for legacy instructions.

0 commit comments

Comments
 (0)