josephworkman has asked for the wisdom of the Perl Monks concerning the following question:

I would like to use Inline::Java in my application, however, I can not be sure that my customers will have a full j2sdk installed on their systems. And I do not want to have that as a requirement. So is is possible to utilize Inline::Java with only a JRE installed? Another way to put it, is can I pre-compile the java piece so that it will run with only a jre on my customer's machine?

I guess I should add that my ultimate requirement is that I would like to use the JDBC module to connect to a Daffodil database (a java database). Right now I am using Expect to connect and run sql to daffodil.

Cheers
Joe
  • Comment on Using Inline::Java with no JDK installed

Replies are listed 'Best First'.
Re: Using Inline::Java with no JDK installed
by gellyfish (Monsignor) on Sep 11, 2006 at 10:58 UTC

    Yes, you need the JDK to install the Inline::Java because it needs some Java classes compiled to create the JVM Server that actually runs the java code on behalf of your Perl program. However if you were somehow able to overcome the install problem (i.e. don't build the JNI component and copy the compiled InlineJavaServer.jar and InlineJavaUser.jar files to the client machine with all the attendant problems,) you can cause Inline::Java to use precompiled classes rather than compiling your code on the fly - see the section entitled STUDYING in the Inline::Java manpage.

    /J\

Re: Using Inline::Java with no JDK installed
by jdtoronto (Prior) on Sep 11, 2006 at 17:09 UTC
    Like I said in the CB: Java::Import would seem to do what you want.

    Updated: One of my colleagues just made the comment that Daffodil also has an ODBC driver, so you should be able to use it from Perl without needing Java at all.

    jdtoronto

Re: Using Inline::Java with no JDK installed
by Anonymous Monk on Sep 11, 2006 at 09:26 UTC
    Have you tried it?
    INSTALLATION: - This module requires Inline version 0.44 or higher to be installed. - It also requires a version of the Java SDK 1.2 or higher to be installed. You can get the latest Java SDK from Sun Microsystems at http://java.sun.com. Follow the provided instructions in order to install the Java SDK properly.
      I have not. I trusted that the install requirements were correct in that you need a full SDK installed to run it.