Questions tagged [java]

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

Filter by
Sorted by
Tagged with
31
votes
1answer
6k 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 ...
28
votes
4answers
7k 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 ...
16
votes
3answers
1k views

Implementing Local HTTP Server

How might I implement a local HTTP server using either Java, C#, C or purely Mathematica? It should be able to respond with Mathematica input to GET and POST requests ideally on W7. This is related ...
16
votes
2answers
391 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 ...
14
votes
3answers
1k 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
1k 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 ...
13
votes
1answer
289 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: ...
13
votes
2answers
662 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: ...
12
votes
1answer
212 views

Using Java log4j in Mathematica

Someone has a code example of how log4j can be used to create logs in Mathematica? RLink uses it, as can be checked in ...
11
votes
7answers
1k views

Installing RLink on Linux

I'm trying to install RLink here. Needs["RLink`"] InstallR[] After downloading it throws an error: ...
11
votes
3answers
3k 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 ...
11
votes
2answers
608 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?
11
votes
3answers
8k 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 ...
11
votes
1answer
478 views

How to set up LinkSnooper for monitoring FrontEnd--Kernel communication?

What is the simplest way to set up LinkSnooper to monitor the communication between the Kernel and the Front End? I am looking for an answer that works on all platforms, including 32-bit Windows.
11
votes
1answer
254 views

Using ImageJ filters directly from Mathematica through J/Link

tl;dr I am looking for a short but complete example that shows how to apply an ImageJ filter to a Mathematica Image through J/Link. Fiji/ImageJ is one of the ...
11
votes
0answers
746 views

How to bundle JLink with Java application using apache maven

The context: I am planning to visualize some results from my MMA code using D3.js. So I wanted to make a simple REST api using the light weight SparkJava framework. Given my fairly nonexistent ...
10
votes
2answers
837 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 ...
10
votes
2answers
385 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). ...
10
votes
1answer
351 views

Fast way to pass an array of integers to Java using JLink

I am using a package from java to compress a list of integers, this package provide me two methods, one for compress and other one for uncompress. Each of these methods has a version to ...
10
votes
1answer
229 views

Converting text from unsupported encodings like 866 into known by Mathematica?

The list of character encodings currently supported by Mathematica is still extremely limited. For example, it supports only three standard IBM PC (OEM) code pages: ...
10
votes
0answers
576 views

J/Link doesn't work with Java 8?

I have some code that successfully uses J/Link (well... until today when something I was doing something with it that crashed the JVM, so), and I recently tried running it under Java 8. I then get a ...
9
votes
2answers
2k 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
3answers
2k 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 ...
9
votes
1answer
1k views

How can I connect to the IB TWS platform from Mathematica?

TWS is the trading platform of Interactive Brokers. Accessing it programmatically could be useful for various purposes. How could I access it from Mathematica ?
9
votes
1answer
118 views

How to launch a separate Java VM on each sub-Kernel?

I have some code that process very large flat files in to separate HSQL(Standalone) databases using ParallelSubmit and JDBC for each file using the strategy in this post (19542). Lately I keep ...
9
votes
1answer
253 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
132 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 ...
8
votes
1answer
520 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 ...
8
votes
0answers
687 views

Problems running Mathematica 10 with Workbench 2 Windows 7 64 bit

My Workbench runs perfectly using Mathematica 9, however simple things which run just using the Mathematica 10 front end won't run when using Mathematica 10 and Workbench 2. These simple two lines of ...
7
votes
2answers
253 views

Why doesn't Import work with XOWA offline Wikipedia database?

I'm having trouble with importing HTML from XOWA offline wikipedia database. I set up a local server for datamining, but I can't access it with Mathematica. I can request a HTML page with ...
7
votes
2answers
642 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: ...
7
votes
1answer
203 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 ...
7
votes
1answer
2k 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 ...
7
votes
2answers
925 views

How can I integrate Open-CV with Mathematica?

I would like to run Open-CV functions from within Mathematica, can anyone figure out how to do this?
7
votes
1answer
138 views

J/Link stealing focus from the Front End on OS X. Workaround?

Link to Wolfram Community version Calling getDefaultToolkit() through J/Link causes the Front End to lose focus. This is specific to OS X. Here is a minimal ...
7
votes
1answer
475 views

How to create keypress simulation program?

Main Problem I'm trying to create a widely applicable keypress simulation program, but I don't know how to use Java so I can only search for Q&As on the site, which is inefficient. So I want to ...
7
votes
1answer
1k views

How can I see more of the Java stack trace when an exception occurs in JLink?

If I call into Java code via JLink`, and there is an uncaught exception, Mathematica produces a Java::excptn message, and prints ...
7
votes
1answer
419 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.
7
votes
1answer
401 views

Add new JDBC Driver to connect MM to SQL database

I cannot open a SQLConnection to a SQL vectorwise database and I assume the JDBC driver is the problem. A JAR file was provided to me - the only info additionally provided to me was the java class: ...
7
votes
1answer
1k 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
2answers
502 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
212 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 here....
6
votes
1answer
907 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
337 views

How to find out the current memory on the JVM?

I want to find out the amount of memory available in the Java Virutal Machine. I tried: ...
6
votes
1answer
1k 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 ...
6
votes
1answer
175 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?
6
votes
0answers
149 views

Echo server with Mathematica

Consider the following scenario: two wireless notebooks communicating via ad hoc one computer (the client) send packets via TCP protocol without Mathematica the other one is an echo server ...
6
votes
0answers
176 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: ...
5
votes
2answers
413 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 ...
5
votes
1answer
170 views

Why can 10.3.1 import a 2MB excel file, but 10.4.0 cannot, with the same commands and file?

Here is the code: ...