eclipse 龙目岛在日食火星中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31297342/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Lombok not working in eclipse mars
提问by Vivek Goel
I have eclipse version: "Mars Release (4.5.0)"
我有 Eclipse 版本:“Mars Release (4.5.0)”
I have downloaded latest lombok jar from: https://projectlombok.org/download.html
我已经从以下位置下载了最新的 lombok jar:https: //projectlombok.org/download.html
I executed:
我执行了:
java -jar lombok.jar install $eclipseDir
After this I can see lombok.jar in my eclipse directory and eclipse.ini.
在此之后,我可以在我的 eclipse 目录和 eclipse.ini 中看到 lombok.jar。
Restarted eclipse with: eclipse -clean
使用以下命令重新启动 eclipse:eclipse -clean
But still lombok is not working for me.
但 lombok 仍然不适合我。
回答by Pawel
I had the same problem. What helped was:
我有同样的问题。有帮助的是:
- Restart Eclipse
- Select from top menu Project -> Clean...
- Clean all projects that use Lombok
- 重启 Eclipse
- 从顶部菜单 Project -> Clean... 中选择
- 清理所有使用 Lombok 的项目
If it will not help, try again from point 1. (I know it sounds stupid but it worked on my PC on second try.)
如果它没有帮助,请从第 1 点重试。(我知道这听起来很愚蠢,但它在第二次尝试时在我的 PC 上工作。)
Also, I'm using Lombok version 1.16.4 (and Eclipse Mars of course)
另外,我使用的是 Lombok 版本 1.16.4(当然还有 Eclipse Mars)
BTW: Make sure that you have lombok.jar in the eclipse directory.
顺便说一句:确保您在 eclipse 目录中有 lombok.jar。
回答by Shiva Achari
I was facing the same issue in Eclipse Neon.2 and in STS 3.8.3 the solution was
我在 Eclipse Neon.2 和 STS 3.8.3 中面临同样的问题,解决方案是
Download the Lombok jar from https://projectlombok.org/download.html
Execute java -jar lombok.jar
- Configure the Eclipse or STS and install. It will copy the lombok.jar under Eclipse dir and add the line -javaagent:../Eclipse/lombok.jar in eclipse.ini or STS.ini
- Make sure in About eclipse -> Installation Details -> Configuration -javaagent:../Eclipse/lombok.jar line exists
- If it's a git project then delete the project from workspace and import the project again. or else export the project and then import it again Hope it helps someone!
从https://projectlombok.org/download.html下载 Lombok jar
执行 java -jar lombok.jar
- 配置 Eclipse 或 STS 并安装。它将复制 Eclipse 目录下的 lombok.jar 并在 eclipse.ini 或 STS.ini 中添加行 -javaagent:../Eclipse/lombok.jar
- 确保在 About eclipse -> Installation Details -> Configuration -javaagent:../Eclipse/lombok.jar 行中存在
- 如果它是一个 git 项目,则从工作区中删除该项目并再次导入该项目。或者导出项目然后再次导入希望它对某人有所帮助!
回答by vivisidea
I have solved the same problem, here are my steps
我已经解决了同样的问题,这是我的步骤
- check eclipse.ini, make sure lombok is properly installed
- restart eclipse
- project->clean, clean your project
- window->show view->problems, Ctrl+A to select ALL errors, right click & delete
- project->clean, clean your project again
- 检查 eclipse.ini,确保 lombok 已正确安装
- 重启日食
- 项目->清理,清理你的项目
- window->show view->problems,Ctrl+A选择所有错误,右键删除
- 项目->清理,再次清理你的项目
I think that should work.
我认为这应该有效。
回答by Jose Quinteiro
On mac os this is because the location of eclipse.ini has changed. Kepler and Luna used Eclipse.app/Contents/MacOS/eclipse.ini
. Mars uses Eclipse.app/Contents/Eclipse/eclipse.ini.
在 mac os 上,这是因为 eclipse.ini 的位置已更改。开普勒和卢娜使用Eclipse.app/Contents/MacOS/eclipse.ini
。火星使用Eclipse.app/Contents/Eclipse/eclipse.ini.
It looks like this has broken Lombok's Eclipse auto-detection as well.
看起来这也破坏了 Lombok 的 Eclipse 自动检测。
回答by bbh
eclipse.ini edit and project clean
eclipse.ini 编辑和项目清理
-vmargs -javaagent:lombok.jar
回答by Pete_ch
run the jar- I just double clicked on it; Add the following to eclipse .ini, and have lombok.jar in the eclipse folder
运行 jar - 我只是双击它;在eclipse .ini中添加以下内容,eclipse文件夹中有lombok.jar
-vmargs
-javaagent:lombok.jar
Windows 7 + eclipse mars
Windows 7 + eclipse 火星
回答by Ash_P
I just got the solution for this issue is as explain below.
我刚刚得到了这个问题的解决方案,如下所述。
1. Download Lombok Jar File -Its better to have a Maven/Gradle dependency in your application. The maven depency can be found here: https://mvnrepository.com/artifact/org.projectlombok/lombok
1. 下载 Lombok Jar 文件 -最好在您的应用程序中有 Maven/Gradle 依赖项。Maven 依赖可以在这里找到:https://mvnrepository.com/artifact/org.projectlombok/lombok
2. Start Lombok Installation -
Once the jar downloaded in Local repository, goto the jar location from command prompt and run the following command java -jar lombok-1.16.18.jar
and we should be greeted by Lombok installation window provided by lombok like this.
2. 开始安装 Lombok -
在本地存储库中下载 jar 后,从命令提示符转到 jar 位置并运行以下命令java -jar lombok-1.16.18.jar
,我们应该会看到 lombok 提供的 Lombok 安装窗口,如下所示。
3. Give Lombok Install Path -Now click on the “Specify Location”
button and locate the eclipse.exe/STS.exe
path under eclipse installation folder like this.
3. 提供 Lombok 安装路径 -现在单击“Specify Location”
按钮并找到eclipse.exe/STS.exe
eclipse 安装文件夹下的路径,如下所示。
4. Finish Lombok Installation -Now we need to finally install this by clicking the “Install/Update”button and we should finished installing lombok in eclipse and we are ready to use its hidden power. Final screen will look like,
4. 完成 Lombok 安装 -现在我们需要通过单击“安装/更新”按钮来最终安装它,我们应该在 eclipse 中完成了 lombok 的安装,我们已经准备好使用它的隐藏功能了。最终屏幕看起来像,
5. Please make sure to add below entry into the STS.ini
file, if its not already there.
5. 请确保将以下条目添加到STS.ini
文件中,如果它还没有的话。
-vmargs -javaagent:lombok.jar
Note: After doing all this if this doesn't worked then make sure to change the workspace and build the code again. It will work.
注意:完成所有这些后,如果这不起作用,请确保更改工作区并再次构建代码。它会起作用。
回答by tomasb
Have the same problem with Ubuntu 14.04, when I jump into eclipse directory and run the executable there, it is ok, however when the launcher icon is used, the entire eclipse.ini is being ignored for some reason.
Ubuntu 14.04 也有同样的问题,当我跳转到 eclipse 目录并在那里运行可执行文件时,没问题,但是当使用启动器图标时,由于某种原因,整个 eclipse.ini 都被忽略了。
回答by Jim Sime
Had similar problem with Neon. The problem was that the version of lombok.jar installed in the Eclipse directory was not the same as the version specified in pom.xml.
霓虹灯也有类似的问题。问题是Eclipse目录下安装的lombok.jar版本与pom.xml中指定的版本不一致。