I finally can build java example. it's cool but how can use IntelliJ to programming and build a project.
I want to use JavaFX and maven in IntelliJ to build a desktop application, can anyone help me?
I use IntelliJ to develop Java solution. Once you've built the Java example, you can copy all the Java files *.java into Maven source directory src/main/java. Don't forget the generated one โ org.drinkless.tdlib.TdApi.java. Once you've copied everything, the structure looks like:
$ tree src/main/java/
src/main/java/
โโโ yourpackage
โย ย โโโ A.java
โย ย โโโ B.java
โย ย โโโ C.java
โโโ org
โโโ drinkless
โโโ tdlib
โโโ Client.java
โโโ Log.java
โโโ TdApi.java
โโโ example
โโโ Example.java
You can now develop your own solution as a usual Maven project. However, there's a tricky point for execution. You must include the Telegram Database library (JNI) to run your final JAR:
$ java -Djava.library.path=/path/to/tdlib -jar /path/to/jar
tnx @mincong-h, I don't look to org.drinkless.tdlib folder after the build Java.
it looks like fine but I have two another problem
java.library.path=/Users/peter/Downloads/td/ to VM options of Run/Debug Configurations bug get this errorError: Could not find or load main class java.library.path=.Users.peter.Downloads.td.how to run the project from IntelliJ? I add java.library.path=
/Users/peter/Downloads/td/to VM options of Run/Debug Configurations bug get this error
Error: Could not find or load main class java.library.path=.Users.peter.Downloads.td.
The main class should be org.drinkless.tdlib.example.Example.java, where the static method main is defined:
public static void main(String[] args) throws InterruptedException { ... }
I don't use Run/Debug configurations in IntelliJ. I ran the final JAR directly... So I don't know how to configure it.
I use this library for java packager.
how to add tdlib to it or another library for java packager? JavaFX-maven-plugin can add VM option my question is how to add tdlib to it for all windows
Sorry I don't know this one, neither.
I found my mistake, yes I run org.drinkless.tdlib.example.Example.java but must set -Djava.library.path=/Users/peter/Downloads/td/ instead of java.library.path=... but another error happend
Exception in thread "main" java.lang.UnsatisfiedLinkError: no tdjni in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.drinkless.tdlib.example.Example.<clinit>(Example.java:58)
I working on mac any idea for this?
can you give me a pom file to compile a jar file?
-Djava.library.path=/Users/peter/Downloads/td/
This path is incorrect. The shared library is stored in /Users/peter/Downloads/td/example/java/bin, which is relevant with the documentation:
Now you can run Java example:
cd <path to TDLib sources>/example/java/bin java '-Djava.library.path=.' org/drinkless/tdlib/example/Example
For the POM file, you can take a look at Stack Overflow: How can I create an executable JAR with dependencies using Maven?
tnx @mincong-h, I run this project on IntelliJ with VM options of Run/Debug configurations.
and in maven, I think maybe need other option to set for compile code but this is not and it's like other projects
Most helpful comment
tnx @mincong-h, I run this project on IntelliJ with VM options of Run/Debug configurations.
and in maven, I think maybe need other option to set for compile code but this is not and it's like other projects