Questions about interfacing Mathematica and Java, particularly using J/Link.

learn more… | top users | synonyms (1)

4
votes
1answer
64 views

InstallJava on a parallel kernel while debugging in Wolfram Workbench

Here's my problem. I need to create a link between a client that is a parallel Wolfram kernel and a server through a Java API. I'm using Wolfram Workbench in debugging mode (like most of the time ...
4
votes
1answer
321 views

How to fix MIDI playback on OS X?

Sometimes sounds specified using SoundNote (i.e. things played using MIDI) don't play properly on OS X. Some notes are missing and some are stuck. At least this ...
4
votes
1answer
542 views

How do I get java to recognize import com.wolfram.jlink

I'm trying to write a java program that uses mathematica code for processing and graphs while using java for the front end. From what I've been able to glean from the j/link tutorials on the wolfram ...
4
votes
1answer
74 views

Is it possible to get the locations and dimensions of all boxes in a StandardForm expression renderation?

I can select all the boxes in a StandardForm rendered expression, like I've selected the left parenthesis in the picture above. Is it possible to get the positions and dimensions of all of these ...
4
votes
0answers
94 views

How to make an executable .jar connect to Mathematica

I am writing a Java Swing program which collects data and connects to Mathematica to do some computations. As other answers here suggested, I have included JLink.jar in the classpath, as well as the ...
4
votes
0answers
122 views

IntelliJIdea front-end plugin with JLink [closed]

I did some proof-of-concept work on having Mathematica Front-End (MathSessionPane) in the IntelliJ Idea as a plugin https://github.com/dubrousky/Mathematica-REPL. It uses JLink as a runtime dependency ...
4
votes
0answers
287 views

How to improve gesture detection by JLink for the LeapMotion controller

Building on this thread (where I cannot add anything anymore somehow) and with this nice answer I kind of got swipe detection to work, but it is not very responsive. How to improve (in the sense of ...
4
votes
0answers
298 views

Why does OS X need permission to allow JLink connections each time it starts?

I understand that JLink loads each time Mathematica launches or each time a kernel starts, and that this can require permission from the firewall, if it is enabled but OS X provides settings the ...
3
votes
2answers
175 views

Passing an internal static class in JLink?

I am trying to get started with the Stanford NER tools tools in Mathematica, and am having difficulty translating the demo they provide into JLink. The relevant code in the demo is: ...
3
votes
1answer
180 views

How could get all escape characters in Mathematica?

I am evaluating expression by using KernelLink. But the kernel will be suspended endless when meets a invalid escape character. ...
3
votes
1answer
158 views

Problem trying to compile JLink application

I have no trouble compiling and running the sample Java to Mathematica program SampleProgram.java that can be found in the Wolfram installation: ...
3
votes
1answer
214 views

Creating a generic empty list with JLink

I'm trying to reproduce a Java code in Mathematica using JLink, I'm making calls to an API in a JAR file. For one of the function call an empty list of a given type is needed but I don't know the ...
3
votes
1answer
308 views

Mathematica 9, Mavericks, Java

I've been trying to get a clear story regarding the interaction of these three components before upgrading my system from Lion to Mavericks --- I can't afford a Mathematica disaster. What I think is ...
3
votes
1answer
239 views

Creating event handler with ImplementJavaInterface inside a package

I am trying to make my Mathematica function to serve as an event handler for the events generated by a Java object. Specifically, I have a Java object that connects as a client to a server that ...
3
votes
1answer
504 views

How do I run scripts on networked computers directly from Mathematica?

The answer to an earlier question, Computers running Wolfram Lightweight Grid Manager won't fall asleep, left me with a new problem. To review, I have a computing environment comprised of: 27" ...
3
votes
1answer
72 views

How to stop running Java?

<< JLink`; InstallJava[]; Clear[serverSocket, socket]; serverSocket = JavaNew["java.net.ServerSocket", 12345]; socket = serverSocket@accept[]; If I enter ...
3
votes
1answer
325 views

How do you get Weisstein’s Hyphenate package to run?

I've put Eric Weisstein's Hyphenate.m package in $UserBaseDirectory/Utilities; installed the requisite ...
3
votes
0answers
38 views

What is the appropriate way to handle JVM memory issues in a Mathematica package?

I maintain a large Mathematica package (here) that, for certain operations, calls out to a Java library (here). The details of the libraries are not important, but I've come across a frustration with ...
3
votes
0answers
29 views

Can JLink return a structured object?

What I want to achieve seems obvious but I cannot figure it out: I need to find a way that when I send an expression to be evaluated from a Java back end to a Mathematica kernel, I can live with it ...
3
votes
0answers
37 views

Java anonymous functions from JLink?

JLink is really great to act on Java objects and access Java static methods. I'm asking myself if there would be a way to have access to a more recent Java syntax that allows anonymous functions, ...
3
votes
0answers
71 views

Showing Mathematica's dynamic UI in external Java programs

I want to run Mathematica from an external Java program and display an interactive app in my own Jpanel. Is it possible? When I tried using MathGraphicsJpanel, I am getting only the snapshot of the ...
3
votes
0answers
58 views

Create custom mappings of Mathematica Expressions => Java Objects?

I would like to call a JLink-based java function from Mathematica with a Mathematica Span[] object as shorthand, like so... ...
2
votes
1answer
73 views

What is the Java converter?

I notice that there is a directory: C:\Program Files\Wolfram Research\Mathematica\10.2\SystemFiles\Converters\Java. What is this? I could not find any documentation ...
2
votes
1answer
174 views

Clojuratica setup

I am trying to get Clojuratica set up (MMa v 9 free trial) (on a Mac running Mavericks) I am following the instructions in "Clojure Data Analysis Cookbook" but have also followed the instructions: ...
2
votes
2answers
278 views

Running Mathematica via JLink from a Servlet on Tomcat 7 Problem

I'm trying to make a java servlet running on Tomcat 7 for specilized mathematical calculations. So I want to link Wolfram Mathematica 8.0 mathkernel from my servlet via JLink (webMathmatica is not an ...
2
votes
1answer
127 views

Can I use Mathematica Online kernel to evaluate expressions from java on my PC?

I know it's possible to evaluate expressions using Mathematica kernel that's on my computer using J/Link. Is it possible to do the same but use the remote kernel that my Mathematica Online uses?
2
votes
1answer
170 views

How to get a audio file's duration time in Mathematica?

I have a *.avi file and if I want to know the file's duration time: I can use this code to get the result: Import["test.avi", "Duration"] or the code to get the ...
2
votes
1answer
53 views

JLink does not preserve the input cell number

I use JLink for connecting to the Mathematica kernel and evaluate some expressions. The In[] prompt is not continuous - it has step 3. I.e. the first expression is In[1] and after the evaluation the ...
2
votes
1answer
92 views

JLink function not producing result

I have a simple JLink function as follows: ...
2
votes
1answer
134 views

J/Link: InstallJava[..] or ReinstallJava[..] hangs when used with a link to a remote jvm running Install.main

While I am able to use InstallJava[] (or ReinstallJava[] for that matter) with a TCP/IP link to a JVM running on the same system ...
2
votes
2answers
130 views

J/Link: getArray2() returns wrong array

I want to convert a matrix from Mathematica to an int[][] in Java. I use the code below: ...
2
votes
1answer
115 views

MathGraphicsJPanel no output

I am trying to create a Java frontend for Mathematica. Following examples from J/Link guide and looking around the API manual I came up with this code: ...
2
votes
0answers
80 views

How to run existing mathematica nb from Java

I have the Mathematica notebook (Test.nb in this case), how can I run in from Java? So far I have the following code. If I type: ...
2
votes
0answers
96 views

Graphics always rendered twice with SimpleFrontEnd example?

I am looking at the Java SimpleFrontEnd example provided by Mathematica. Everything goes well except it always renders graphics twice. Can anyone help me with ...
2
votes
1answer
206 views

Executing C programs within mathematica [duplicate]

I have a requirement for executing a C program within Mathematica. The user will provide the inputs and the expected results on a front end. Mathematica runs the C file, obtains the result for the ...
2
votes
0answers
931 views

mathematica startup time

I have Mathematica 7 and 8 installed on my laptop. Mathematica 7 starts quite fast, but Mathematica 8 is extremely slow to start. In the Option Inspector I canceled the "welcome screen" option at ...
1
vote
1answer
401 views

Wolfram Workbench problem with JLink

I'm working on Wolfram Workbench 2.0 and I'm creating a JLink Application project. Below there is the code: ...
1
vote
1answer
691 views

Calling Mathematica from Java

I'm trying to write a Java program that uses Mathematica code, but when I compile it, a window appears asking for MathLink. I enter ...
1
vote
1answer
47 views

How to fix a “Java failed to load class” when using custom Java class using JLink?

I have a Java project compiled into a jar file with a class called HttpClientSSO. The commandline java -cp bota.jar org.nilostep.bota.HttpClientSSO executes ...
1
vote
1answer
52 views

can CDFDeploy command work via JLink

I tried the following command in notebook. It creates a .cdf file. ...
1
vote
0answers
23 views

MathCanvas.setMathCommand behaving badly and I have no Idea how to debug

For my first attempt to call Mathematica from Java, I got the GraphicsApp sample program working, then defined a package with a function called "metric" and made sure that that package works when ...
1
vote
0answers
65 views

Awkward DatabaseLink JDBC Error [closed]

I've created a GUI application (a database editor) that uses DatabaseLink and it is currently working fine on my PC (M10.02, Windows 7) and on a clients's PC (CDF Player Pro 10.02, Windiws 8). While ...
1
vote
0answers
119 views

using Mathematica library in Java

I am trying to build a Math expression calculator in Java. Is any way for using Mathematica libraries in Java program without ...
1
vote
0answers
74 views

Using GUI with JLink

How to handle Input/Manipulate expressions using JLink? Say I want to handle the $Input[]$ expression sent via JLink to the MathKernel. Currently the my app blocks on waiting the response. How this ...
1
vote
0answers
47 views

How to call a java method that takes a boolean (not Boolean)?

I'm trying to call a method on a java object that takes a single boolean argument - note boolean (native or primative) not Boolean (Object or Reference type). ...
1
vote
0answers
58 views

Is there any metadata-holding mechanisms in Mathematica programming similar to Java annotations?

I'm re-implementing some tools previously implemented in Java in Wolfram Language. Is there any metadata-holding mechanisms in Mathematica programming similar to Java annotations?
1
vote
0answers
52 views

Clojuratica setup in Windows

I have been trying to setup Clojuratica on Windows using instructions from Clojure Data Analysis Cookbook and http://drcabana.org/2012/10/23/installation-and-configuration-of-clojuratica/ Each time I ...
1
vote
0answers
254 views

InstallJava::fail error when importing an image with a Raspberry Pi

I'm trying to import an image in Mathematica on my Raspberry Pi. The code is simple but I get an error when importing: ...
1
vote
0answers
73 views

Creating a Mathematica executable that uses JLink [duplicate]

I am making a program in Mathematica that uses the Robot class of Java and some other Mathematica functions. I want the end product to be a standalone executable that can run even if a computer does ...
0
votes
2answers
4k views

KeyPress function in Java's Robot class, how to state parameter?

I am trying to use Java's Robot class to type. This is what I have done so far. Needs["JLink`"]; InstallJava[]; robot = JavaNew["java.awt.Robot"] The mouseMove ...