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

learn more… | top users | synonyms (1)

22
votes
1answer
2k views

Programmatically retrieving e-mails from a remote server

Mathematica has a function for sending mail (SendMail) and can import the MBOX format. But what I'd like to do is ...
21
votes
4answers
2k views

Efficiently determining if 3D points are within a surface composed of polygons

This is the 2nd part of a previous question which I edited to make into 2 separate questions: Extracting polygons from 3D contour plot surface As an extension of my earlier question involving simple ...
14
votes
3answers
671 views

Mathematica usage (success stories) for financial back-ends

I've been working for about 5 years in Java, developing financial back-offices (web-services, business logic, report generation etc.). I think Mathematica is very suitable for such calculations and ...
13
votes
2answers
308 views

Interfacing Mathematica with MINE using JLink

In last December's Science David N. Reshef, et al. proposed an interesting method to detect associations in data (Detecting Novel Associations in Large Data Sets, Science 334, 1518, 2011). Contrary to ...
10
votes
2answers
412 views

How can I connect Mathematica to Clojure?

I'm using Clojure and I'd really love to be able to use some of Mathematica's functions inside it. Can anyone help with mathlinking it?
9
votes
2answers
859 views

Using J/Link to decode Google Maps Polyline strings

I would like to use this java code inside Mathematica using J/Link. It converts Google Maps API Encoded Polylines to a list of points. I tried the Mathematica tutorial but got lost. There is the Java ...
9
votes
1answer
145 views

MakeJavaObject on list of inhomogeneous objects belonging to the same base class

When using J/Link, how can we create an array out of objects belonging to different classes but having the same base class? Here's an example: ...
9
votes
1answer
201 views

How secure is J/Link?

Are there security concerns with using J/Link? If so, is there any way to encrypt the data passed between Mathematica and Java? If Mathematica and the JVM are running on the same machine, is there any ...
8
votes
2answers
1k views

Dynamic graph visualisation using JLink/Java and GraphStream

Visualising the addition of new nodes and edges to a graph to 'watch it grow' is to something Mathematica is not suited to by default. However this type of animation really helps convey the emergence ...
8
votes
2answers
588 views

Why is JLink loaded every time I start Mathematica?

When I start a Mathematica 8 session (either command line or with the notebook front end), I notice that there are several packages that have already been loaded for me (using ...
8
votes
2answers
2k views

Connect to SQLite database

I am trying to connect to a SQLite database and since there is no officially supported driver; I decided to use the sqlite-jdbc driver and port the respective code into Mathematica. However, the ...
7
votes
5answers
542 views

Installing RLink on Linux

I'm trying to install RLink here. Needs["RLink`"] InstallR[] After downloading it throws an error: ...
7
votes
2answers
154 views

Giving JLink Huge Memory by Default

I have noticed that Mathematica makes use of Java by way of JLink, for example, in the extensions such as DatabaseLink and (I think) RLink. It also seems like Java is a first-class citizen for writing ...
7
votes
2answers
174 views

Working with Java hashmaps from Mathematica

I'm using J/Link to access data from an external Java program. The data are represented as a ConcurrentHashMap (see the official specification here). ...
7
votes
1answer
282 views

Why does JLink lock unopened jar-files in Windows

Since the introduction of JLink (maybe a bit later) it is possible to put jar libraries inside the directory-structure of packages. If this package is installed in ...
7
votes
1answer
565 views

Efficiently deleting rows in many large text files

I have 500 text files each of about 200000 rows. I need to delete one row in each of them as fast as possible (later such operations will repeat). What is the best way to do this with Mathematica? ...
6
votes
1answer
1k views

How to execute a function in the package from java?

I use Wolfram Workbench 2.0. I can get a KernelLink object and evaluate some simple expressions like "2+2". But I don't know how to export a package and execute ...
6
votes
2answers
354 views

Unit testing J/Link projects in Workbench

I am having some problems setting up the MUnit testing framework for a J/Link project and would be grateful for advice. I do have J/Link working when running or debugging the .nb notebook in ...
6
votes
1answer
567 views

Using a user defined Mathematica package with MathLink

I'm trying to create a Java program that uses some methods from a mathematica package I've defined. When I run my java program though the output of the program acts as though the Mathematica methods ...
6
votes
1answer
54 views

Connect Frontend to Kernel Started by JVM via JLink

I have a MathKernel started and controlled via JLink from a JVM. The $CommandLine for this kernel is: ...
6
votes
1answer
117 views

J/Link: Callback from J/Link into Java when Mathematica process terminates?

Is it possible to get a callback from J/Link into java when the (remote) link closes or the Mathematica process is terminated (killed) altogether?
5
votes
2answers
772 views

Failed to connect remote Mathematica kernel using J/Link

I'm trying to connect to a remote Mathematica 8 kernel (on a Windows machine) using J/Link. On the client machine, I put the JLinkNativeLibrary.dll file in ...
5
votes
1answer
114 views

Using enum values with J/Link

How can I pass enum values to a function when using J/Link? What is the correct syntax for typing an enum value? For example, call normalize() using ...
5
votes
1answer
83 views

Using J/Link with Wolfram Programming Cloud

Is it possible to use J/Link in a Wolfram Programming Cloud notebook? I need it to load and use 3rd-party .jars.
5
votes
0answers
138 views

How to deal with WebServices error “any is not supported in sequence”?

I am trying to aquire data through Mathematica's WebServices and this example works just fine: ...
4
votes
2answers
161 views

Automate mouse clicks with Mathematica

I need to automate mouse clicks with Mathematica. However, a similiar question was closed on this forum, without any answer. Consider the following steps: ...
4
votes
2answers
170 views

J/Link: How to run a thread inside Mathematica

In the J/Link User Guide there is no example on how to use java.lang.Thread, from inside Mathematica. I'd like to know if is possible to start a thread from a ...
4
votes
1answer
82 views

LinkSnooper troubles on Windows

I'm trying to get LinkSnooper up and working on a Windows 7 machine to monitor the interaction between the Mathematica front end and MathLink. I'm facing great troubles following the instructions ...
4
votes
1answer
183 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
267 views

Error trying to open a notebook in Wolfram Workbench [duplicate]

I recently set up Mathematica 9.0.1 on a new computer, along with x64 Eclipse Indigo with JRE 1.7, and the Wolfram Workbench 2 plug-in. Something is amiss, because when I try to do any sort of task ...
4
votes
0answers
47 views

Possible JLink memory leak (during) object creation

Using MMA 9.0.1 on win7-64. When creating a large number of java objects I noticed memory being consumed in huge quantities (several Gb). This memory is returned/deallocated after my call ...
4
votes
0answers
181 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
217 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
79 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
174 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
150 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
391 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
433 views

Using SimMetrics Java Function on Mathematica

I would like to know if it's possible to use/install this java library on Mathematica. This library, named SimMetrics, has a lot of string similarity functions that I would like to test. Here is the ...
3
votes
1answer
264 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 ...
3
votes
1answer
262 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 ...
2
votes
1answer
123 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
221 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
62 views

JLink function not producing result

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

Java Heap Space Error on data insertion over SQL Server

I'm trying to insert 2-milliion lines into a SQL Database, and get this error: JDBC::error: Java heap space The insert is a standart Mathematica SQL statement: ...
2
votes
1answer
88 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
96 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
99 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
83 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
149 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
359 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 ...