将项目(jar)导入Eclipse [英] Import project (jar) into Eclipse

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

问题描述

我有一个.jar文件,我需要导入到Eclipse。但是,我不想让jar作为引用的库。我需要.jar被包含像一个正常项目,包(!)和.java文件。



我尝试执行以下操作:
新建Java项目 - >导入 - >常规 - >归档文件。在这种情况下,当我将这个jar也放在一个引用的库中时,它被导入但是带有.class文件。



新的Java项目 - >导入 - >常规 - >文件系统。导入.java文件,但是包丢失并且是正常的文件夹。另外,这些文件是奇怪的,因为图标中的j看起来有所不同,并且没有注意到错误(没有下划线)。



将现有项目导入到工作区中根本不工作,说没有项目。我也试图在解压缩之后将jar导入到zip中,这给了我-java文件,但是它破坏了这些包。



有谁知道如何导入正确吗?

解决方案

我以这种方式管理:
新的Java项目 - > Java设置 - >源 - 链接源(源文件夹)。在那里我添加了我的反编译jar,它被正确导入:)


I got a .jar file which I need to import into Eclipse. However, I don't want to have the jar as a referenced library. I need the .jar to be included like a "normal" project, with packages(!) and .java files.

I tried to do the following: New Java project -> Import -> General -> Archive File. In this case, when I place this jar also as a referenced library, it is imported but with .class files.

New Java Project -> Import -> General -> File System. Imports the .java files, but the packages are lost and are normal folders. Also, the files are somehow strange, because the "j" in the icon looks differently, and errors are not noticed (no underlining)

Importing "Existing Projects into Workspace" doesn't work at all, it says that there is no project. I also tried to import the jar as a zip after extracting it, this gives me the -java files, but it destroys the packages.

Does anyone know how to import this correctly?

解决方案

I have managed it this way: New Java Project -> Java settings -> Source -> Link source (Source folder). There I added my decompiled jar and it was imported correctly :)

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

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