Open 04041b opened 6 months ago
You could use
. .\build.ps1; Build-Library -BuildType "Release" -Arch "x64" -LangBinding "java"
to get the lib separately (for windows).
I use this way to get my lib but it still has some problem.
It would be not able to get our IPv4 and IPv6 addresses correctly (My test program returns me both 127.0.0.1
, and the return of native method are both ```(empty)) By the way it could connect to the virtural network, and
MAC,
nodeID``` are correct, which seems to be wried.
Maybe it would be useful for you.
You could use
. .\build.ps1; Build-Library -BuildType "Release" -Arch "x64" -LangBinding "java"
to get the lib separately (for windows).I use this way to get my lib but it still has some problem. It would be not able to get our IPv4 and IPv6 addresses correctly (My test program returns me both
127.0.0.1
, and the return of native method are both`(empty)) By the way it could connect to the virtural network, and
MAC,
nodeID` are correct, which seems to be wried.Maybe it would be useful for you.
Thank you, but I'm looking for a dll file I can import in my java program.
using the command . .\build.ps1; Build-Host -BuildType "Release" -Arch "x64"
yields you a libzt.dll and libzt.lib, but the dll file just don't work
You could see #277 for more info. before import you may rename your dll to zt.dll
, cause the jar source code was written to load that.
See here
If you can reproduce the results of my test in #277, please reply, thank you
It works!!!
All I change is from s_addr to S_addr in #277 and the nlohmann/json fix in #263
Here's the step I made it work
Apply the fix above, my fork with the fix: https://github.com/04041b/libzt
clone it, and
git submodule update --init
run ./build.sh host-jar
in git bash and . .\build.ps1; Build-Library -BuildType "Release" -Arch "x64" -LangBinding "java"
in powershell
copy dist\win-x64-jni-release\lib\libzt.dll and rename it to zt.dll
copy dist-x64-jar-release\pkg\libzt-1.8.10.jar to your project
let me know if this works for you
@MegumiKasuga
Glad to see your success. However my program's bugs remained, even in the situation using your fork.
See Here:
the native method just returns "".
See Here: the native method just returns "".
I did not use native method I use
ZeroTierNode node = new ZeroTierNode();
System.out.println(node.getIPv4Address(networkId).getHostAddress());
They are just the same.
@04041b
I have finally fixed all bugs. The reason is that my JVM used an old version of zt.dll
lies in my $PATH
, which is a broken one. And libzt only supports one socket on one node. Here's my final test.
Server side:
Client side:
I successfully sent
Hello from java!
from C to S.
just in case anyone stumble on this issue I'm going to leave it open until the issue is fixed with scripts https://github.com/zerotier/libzt/issues/267#issuecomment-2132084509
Maybe we could fix the jar documents. This problem has stuck me for years from using the lib.
The thing is I have no idea with the change in JavaSockets.cxx because I don't know c++. The change is a required fix to build. I don't want to have a pull request that contains changes I don't even know.
Maybe we could fix the jar documents. This problem has stuck me for years from using the lib.
Maybe giving suggestions in if
would be a good way. These if
could be useful for others using this project.
Maybe giving suggestions in
if
would be a good way. Theseif
could be useful for others using this project.
i don't quite understand what you mean by "if"
After running command build.sh host-jar on my windows, the jar is only 20 kb, contains no dll file to be extract via jar xf *.jar libzt.dll