java and livecode can that we embedded

Interested adding compiled externals from LiveCode and third parties to your LiveCode projects? This is the place to talk about them.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am
Location: Netherlands

java and livecode can that we embedded

Post by Informatie » Tue May 28, 2013 7:41 pm

I have a simple question, join livecode an

I have a bunch of java files (.java) and I want them to call include them in livecode.
I can start a shell and call the procedure by the following command java -jar getprocess.jar -host param1 and so on.

The problem I have with this Jar method is the calling as shell.
I can embed windows dll or mac osx bundles but java it still bothering me.

Jan Schenkel has some tips but I do something wrong. Is a helper required ?

Q : How do I call a function or procedure in a .java file.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Re: java and livecode can that we embedded

Post by Janschenkel » Tue May 28, 2013 8:29 pm

Hi there,

A few years back I wrote an external that allowed embedding a Java VM in a LiveCode process and then calling commands and functions in it.
This worked quite well (as long as you didn't use it for any GUI stuff using AWT or Swing). But I never published it as RunRev was overhauling the LiveCode externals interface.

However, there are advantages to starting a separate java process.
First of all, you don't have 32-bit/64-bit problems as each process can have its own bit-ness (LiveCode is limited to 32-bit and Oracle doesn't provide a 32-bit on OS X).
Secondly, your LiveCode app can stay responsive to user interaction while the Java process churns away.

This blog post includes a skeleton for delegating tasks to a separate Java process and having these tasks handled in a multi-threaded way.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply

Return to “Using Externals”