导入Java库JAR到Eclipse [英] Importing Java Library JAR into eclipse

查看:159
本文介绍了导入Java库JAR到Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前想实现在其流水线功能的浏览器。问题是,以code中的HTTP管道,我需要一个函数库的支持。我试图通过使用Project将其导入到我的工作区 - >属性 - > Java构建路径 - > addJar。而我能够成功地添加它。但现在我的问题是,即使它被添加到我的工作区它没有让我跑这个code。它给了我错误,如果我没有导入库:

I'm currently trying to implement a browser with pipelining feature in it. The problem is in order to code the HTTP pipeline, i need the support of a library. I tried to import it to my workspace by using Project - > properties -> Java build path ->addJar. And I was able to add it successfully. But now my problem is, even though it is added to my workspace it doesnt let me run this code. It gives me errors as if I have not imported the library:

package com.test.download;
import java.util.Collections;
import org.factor45.*;
    public class Example {

        // Execute the request
        HttpRequestFuture<String> future = client.execute("hotpotato.factor45.org", 80, request,
                                                          new BodyAsStringProcessor());
        future.addListener(new HttpRequestFutureListener<String>() {
            @Override
            public void operationComplete(HttpRequestFuture<String> future) throws Exception {
                System.out.println(future);
                if (future.isSuccessfulResponse()) {
                    System.out.println(future.getProcessedResult());
                }
                client.terminate();
            }
        });
    }

这是在同一个网站,提供我库上面的code可用。 这里的是供你参考的网站。您还可以找到本网站内的JAR文件。

This is available in the same website which provided me the library for the above code. "Here" is the website for your reference. Also you can find the JAR file inside this website.

请帮我找出这个问题。如果你解决这个问题你是一个生命的救星!在此先感谢!

Please help me to figure out the problem. If you solve this you are a life saver! Thanks in advance!

推荐答案

试试这个:

属性>> Java构建路径>> >>库添加外部JAR ...然后选择库

Properties >> Java Build Path >> Libraries >> Add External JARs... Then select the library

这篇关于导入Java库JAR到Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆