diff options
Diffstat (limited to 'protocols/Telegram/tdlib/td/example/java/README.md')
-rw-r--r-- | protocols/Telegram/tdlib/td/example/java/README.md | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/protocols/Telegram/tdlib/td/example/java/README.md b/protocols/Telegram/tdlib/td/example/java/README.md index c2b5c43171..4c7df1916d 100644 --- a/protocols/Telegram/tdlib/td/example/java/README.md +++ b/protocols/Telegram/tdlib/td/example/java/README.md @@ -3,7 +3,11 @@ To run this example, you will need installed JDK >= 1.6. For Javadoc documentation generation PHP is needed. -TDLib should be prebuilt for using with Java and installed to local subdirectory `td/` as follows: +You can find complete build instructions for your operating system at https://tdlib.github.io/td/build.html?language=Java. + +In general, the build process looks as follows. + +TDLib should be prebuilt with JNI bindings and installed to local subdirectory `td/` as follows: ``` cd <path to TDLib sources> mkdir jnibuild @@ -11,9 +15,9 @@ cd jnibuild cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=../example/java/td .. cmake --build . --target install ``` -If you want to compile TDLib for 64-bit Java on Windows using MSVC, you will also need to add `-A x64` option to CMake. +If you want to compile TDLib for 32-bit/64-bit Java on Windows using MSVC, you will also need to add `-A Win32`/`-A x64` option to CMake. -In Windows, use Vcpkg toolchain file by adding parameter -DCMAKE_TOOLCHAIN_FILE=<VCPKG_DIR>/scripts/buildsystems/vcpkg.cmake +In Windows, use vcpkg toolchain file by adding parameter -DCMAKE_TOOLCHAIN_FILE=<VCPKG_DIR>/scripts/buildsystems/vcpkg.cmake Then you can build this example: ``` @@ -32,8 +36,8 @@ cd <path to TDLib sources>/example/java/bin java '-Djava.library.path=.' org/drinkless/tdlib/example/Example ``` -If you get "Could NOT find JNI ..." error from CMake, you need to specify to CMake path to the installed JDK, for example, "-DJAVA_HOME=/usr/lib/jvm/java-8-oracle/". +If you receive "Could NOT find JNI ..." error from CMake, you need to specify to CMake path to the installed JDK, for example, "-DJAVA_HOME=/usr/lib/jvm/java-8-oracle/". -If you get java.lang.UnsatisfiedLinkError with "Can't find dependent libraries", you may also need to copy some dependent shared libraries to `bin/`. +If you receive java.lang.UnsatisfiedLinkError with "Can't find dependent libraries", you may also need to copy some dependent shared OpenSSL and zlib libraries to `bin/`. -In case you compiled the example as 32-bit version, you may need to give -d32 parameter to Java. +Make sure that you compiled the example for the same architecture as your JVM. |