0
$\begingroup$

First of all, here is the link to download the API for Java for Windows.

I initially wanted to use NETLink since I have some experience with it but they have deprecated the API for .NET.

But JLink might be the only option now. I am not familiar with JLink, if someone could create a minimal example for reading data from the example .hyper file that comes with the API download for Java located: tableauhyperapi-java-windows-x86_64-release-main.0.0.17782.r044377f2\examples\data\superstore_sample.hyper.

Even replicating the example code that is written in Java that comes with the API download.

Any help in this regard is much appreciated!

$\endgroup$
6
  • $\begingroup$ According to the information at the site, C++ and python are also supported. C++ can be interfaced to Mathematica through LibraryLink, ForeignFunctionLoad, etc. Python is available via ExternalEvaluate. If you want to use Java and JLink, I'd recommend taking a look at the Tech Note in the documentation. Maybe look at the example programs first to get a rough idea of how it works. There are syntax differences between Java and Mathematica ([] vs (), @ vs a '.' for method calls, etc.), but it's fairly straightforward to call java classes/methods from Mathematica. $\endgroup$
    – user87932
    Commented Oct 9, 2023 at 3:08
  • $\begingroup$ ExternalEvaluate also supports Java, and is an alternative to using JLink; you can call Java code directly, or python etc. So for example, if you wanted to run the stie's python exmaple, you could use ExternalEvaluate to call the .py file directly and get the output in your notebook. $\endgroup$
    – user87932
    Commented Oct 9, 2023 at 3:38
  • $\begingroup$ @jdp Thank you for your responses. I think I am close to getting Java version working. I am thinking about C++ version but in their folder, they provide .lib but there is also a bin folder that has a .dll. In their instructions, they mention we have to compile using cmake. I don't want to do any compiling. Also Python I feel is a slow language to process large volumes of data. Do you think C++ via ForeignFunctionLoad would be more performant compare to Java via JLink? $\endgroup$
    – user13892
    Commented Oct 9, 2023 at 13:53
  • $\begingroup$ @jdp Also is the C++ version going to be cross-platform? Are .dll compiled to work on any platform or there are specific .dll for every platform? $\endgroup$
    – user13892
    Commented Oct 9, 2023 at 14:03
  • $\begingroup$ Code is compiled for a specific operating system, so your .dll is for Windows only. I.e. for Linux, you compile to a .so (shared object) etc. Regarding compiling, they likely provide you with a Makefile or its equivalent, so compiling would involve typing a command and letting the script run. The script will check what software is installed, set up a configuration for your system, and compile without any intervention required on your part. Usually. I don't know how much performance difference there might be between C++/Java. You do have the option of calling Java classes directly from .. $\endgroup$
    – user87932
    Commented Oct 9, 2023 at 16:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.