From efc336e60cf1331bf5f3213d296981b87b8b2a6c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Jun 2023 19:24:05 +0300 Subject: =?UTF-8?q?fixes=20#3537=20(Telegram:=2032-=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=80=D1=8F=D0=B4=D0=BD=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=B0=D0=B4=D0=B0=D0=B5=D1=82=20=D0=B2=20?= =?UTF-8?q?64-=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BD=D0=BE=D0=B9=20Win?= =?UTF-8?q?dows)=20+=20update=20to=20the=20fresh=20TDLIB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/tdlib/td/example/java/README.md | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 protocols/Telegram/tdlib/td/example/java/README.md (limited to 'protocols/Telegram/tdlib/td/example/java/README.md') diff --git a/protocols/Telegram/tdlib/td/example/java/README.md b/protocols/Telegram/tdlib/td/example/java/README.md new file mode 100644 index 0000000000..bca3e7ad9c --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/java/README.md @@ -0,0 +1,43 @@ +# TDLib Java example + +To run this example, you will need installed JDK >= 1.6. +For Javadoc documentation generation PHP is needed. + +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 +mkdir jnibuild +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 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=/scripts/buildsystems/vcpkg.cmake + +After this you can compile the example source code: +``` +cd /example/java +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=/example/java/td/lib/cmake/Td -DCMAKE_INSTALL_PREFIX:PATH=.. .. +cmake --build . --target install +``` + +Compiled TDLib shared library and Java example after that will be placed in bin/ and Javadoc documentation in `docs/`. + +After this you can run the Java example: +``` +cd /example/java/bin +java '-Djava.library.path=.' org/drinkless/tdlib/example/Example +``` + +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 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/`. + +Make sure that you compiled the example for the same architecture as your JVM. -- cgit v1.2.3