cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: using libcurl in Java???

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 23 Sep 2001 11:42:26 +0200 (MET DST)

On Sat, 22 Sep 2001 josh.m.daynard_at_accenture.com wrote:

> |-------------------------------------------------------------------|
> | How to Install |
> | Install curl and libcurl first. Manual hands-on installation is |
> | required for the actual java interface module. |
> |-------------------------------------------------------------------|
>
> What exactly do I need to do for this manual hands-on installation? I
> was able to compile CurlGlue.java and CurlWrite.java into class files but
> when I try to compile the test.java file I get the following errors:

I made it like this:

% cd [to the curl-java dir]
% make (this only works with gcc without changing the makefile)
% java test (runs the test.java program)
[it gets the web page to stdout]

Without using the Makefile, you'll have to do this instead:

javac CurlGlue.java
javah CurlGlue
compile javacurl.c to javacurl.o
link libjavacurl.so from libcurl and javacurl.o
javac test.java

> C:\java\javacurl\test.java:1: '.' expected
> import CurlGlue;
                 ^
> C:\java\javacurl\test.java:2: '.' expected
> import CurlWrite;

> which seems odd because I have CurlGule.class and CurlWrite.class in the
> same directory.

I'm sorry, but I am far from experienced in Java. I only manage to write
simple stuff.

> Sorry for being so clueless here, but I would love a little kickstart
> help in getting this working so I don't have to open a shell to make a
> call to the command line version

I realize that, and I would've liked to have a better java-curl package
prepared (hopefully we'll get that one day). But now we don't and to get that
package working, you need java (JNI) knowledge, it has very little to do with
curl or libcurl.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-23