LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   java/netbeans and libcurl; don't understand how to get it to work (https://www.linuxquestions.org/questions/programming-9/java-netbeans-and-libcurl%3B-dont-understand-how-to-get-it-to-work-837740/)

Wim Sturkenboom 10-13-2010 03:45 AM

java/netbeans and libcurl; don't understand how to get it to work
 
I'm writing a 'little' java app and need to retrieve the content of websites. As far as I understand, libcurl is basically the tool to use for this type of work.

Found a java binding (whatever that might be :scratch:) for libcurl on http://www.gknw.net/viewvc/trunk/?root=curl-java and downloaded/extracted the tarball.

And now I'm at a total loss how to continue.

I'm trying to import the 'library' in my java code (import net.saxx.curl.*) but netbeans complains that it can't find it. Tried adding different paths (possibly the wrong ones; e.g. F:\documents\_Downloads\java_stuff\curl-java-trunk\trunk) in netbeans but it still can't find it.

Code:

F:\documents\_Downloads\java_stuff>tree
Folder PATH listing for volume Data
Volume serial number is 0006EFC4 10D8:EA40
F:.
├───curl-java-trunk
│  └───trunk
│      └───net
│          └───haxx
│              └───curl
├───INIFileSrc
├───Java
└───javacsv

Although there are makefiles in the downloaded tarball, the README does not mention the use of them.

Not very familiar with the environment around java and I think that that is my problem.

Any advice is highly appreciated.

This is, by the way, on a Windows XP machine.

paulsm4 10-13-2010 08:30 PM

Hi -

Q: which tarball did you save?
http://www.gknw.net/mirror/curl/curl_java/
<= Did you download curl-java-0.2.3.tar.gz?

Q: Did you build it?
<= as far as I can tell, it's source-only:
no Java .class files or .jar's

PS:
A Java "wrapper", as you can probably guess, is just a software layer that lets Java call functionality that happens to be written in another language.

Wim Sturkenboom 10-13-2010 11:52 PM

It's version 0.2.2 according to the README and the download link is http://www.gknw.net/viewvc/trunk/?ro...-java&view=tar

And no, I did not build it as the readme did not mention it.

Thanks for the reply, will start 'hunting' for MingW32 (and maybe cycwin if I need that).

ntubski 10-14-2010 09:21 AM

Quote:

Originally Posted by Wim Sturkenboom (Post 4125825)
I'm writing a 'little' java app and need to retrieve the content of websites. As far as I understand, libcurl is basically the tool to use for this type of work.

I think you might be better off using Java's builtin HttpURLConnection class.

Wim Sturkenboom 10-15-2010 11:40 AM

You might very well be right. I will certainly consider after reading up as the current path is not without problems.

I've managed to install MinGW after some trouble (automated installer did not work correctly so it was manual downloads).
Now I'm taking little steps at a time compiling and fixing dependencies for the binding and got stuck again.

I only work on this project 3 days a week, so could not provide feedback yet.

Wim Sturkenboom 10-20-2010 11:42 PM

Thanks all,

marked this one as solved as I'm now using the HttpURLConnection class

When I have time, I will try to get the libcurl binding going


All times are GMT -5. The time now is 02:20 AM.