Link to home
Create AccountLog in
Avatar of onyourmark
onyourmark

asked on

getting and using a Java class

Avatar of Bruce Smith
Bruce Smith
Flag of United States of America image

Go here and click the download button on the left to download it: http://www.cs.waikato.ac.nz/~ml/weka/

Make sure that you look at the requirements to see which version you'll need (depends on your version of Java).

And the Documentation tab will show you how to implement it.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Bruce Smith
Bruce Smith
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of onyourmark
onyourmark

ASKER

Hi. I have downloaded the one that says
Click here to download a self-extracting executable that includes Java VM 1.6
(weka-3-7-3jre.exe; 37.2 MB)
Actually I want to use it like is described here:
http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod

If it depends on the whole API will this be impossible?


Or, if I try this, will it be impossible?

The Java library from perl lets you to easily integrate Java calls in Perl code.

e.g.

use Java;
$java = new Java;
$obj = $java->create_object("com.my.Class","constructor parameter");
$obj->myMethod("method parameter");
$obj->setId(5);
Hi. I have downloaded the one that says
Click here to download a self-extracting executable that includes Java VM 1.6
(weka-3-7-3jre.exe; 37.2 MB)
Actually I want to use it like is described here:
http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod

If it depends on the whole API will this be impossible? And if not, where is the class located on my computer?


Or, if I try this, will it be impossible?

The Java library from perl lets you to easily integrate Java calls in Perl code.

e.g.

use Java;
$java = new Java;
$obj = $java->create_object("com.my.Class","constructor parameter");
$obj->myMethod("method parameter");
$obj->setId(5);
This is a completely different question, but from looking it over it appears that you would be able to do it.

You can use imports apparently. Look at the third code snippet under "Methods" here: http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod#METHODS

You would just have to figure out how to set the weka jar file as a usable library so that you can import the class you want to use. You may email the author of inline::java (patl@cpan.org) as he may be able to help you out with that. Also, you may ask a new question under the Perl zone about how to implement a jar library for use with inline::java.