New answers tagged java
It works now. I had to set up my Workbench project as a JLink project. The project where I was integrating my code into was set up as an Application project. After putting the Jar file into the Java folder I can load classes from it without having to specify any path, which is very easy.
Here's a minimal example using the Java API of IB. Anything else can be done in theory by analogy. It works in Windows, but should work on other platforms as well as it's using Java. Results are displayed in the Mathematica messages window. Prerequisite Read the beginning of https://www.interactivebrokers.com/download/JavaAPIGettingStarted.pdf , download ...
Java's implementation of generics uses erased types. Consequently, there is not actually any runtime implementation difference between, say, a List<Integer> and a List<String>. The virtual machine representation of both types is actually just List<Object>. From within Mathematica, we need not (and cannot) explicitly express any generic ...
This is how you can achieve what you try to do: Needs["JLink`"] InstallJava LoadJavaClass["java.lang.Runtime"] runtime = Runtime`getRuntime runtime@freeMemory I think the reason that you can not instanciate a java.lang.Runtime object the usual way is that it is a singleton and the only way to get a handle to the one instance is the ...
Top 50 recent answers are included