Consume jar files

I am looking to use Solr (or Lucene) from java source, compile it and use it in C# and Swift (it seems possible?)

First I was looking to use externs with library, but this So post advices to consume jar instead.

If I understand correctly…

-cp src
-main Main
-java-lib ./dependencies/solr/solr-core-8.8.1.jar

I run haxe --main src.Main --interp in terminal.

I expect the modules/namespaces to appear in vscode autocompletion (having Haxe Extension Pack in vscode. installed)?

Am I missing or misunderstanding something. How can I consume jar file with haxe?

I tried to consume a simple jar made from a hello world java sample.
It does not show up in the intellisense in vscode.

And when trying to run haxe --main src.Main --interp --java-lib dependencies/example/Main.jar


Error: Target eval does not support native libraries (trying to load dependencies/example/Main.jar)

I found some discussion about it here: JVM target a few questions - #7 by kevinresol

This does not run your hxml file, but run the Main class though the eval target.
You need to compile with haxe build.hxml.

You can only use --java-lib with the java target.

Is the same true when using externs, that the library only can be used for one target?

If library is cross platform (for example pure Haxe one) then it can be used in multiple / all targets, but in case of platform specific ones you can use only for dedicated target, like jar files can only be used if targeting java project

I will probably multi target. Using multiple platform specific search engine libs