IT Share you

Eclipse (Helios)에서 Project Lombok이 작동하도록 할 수 없음

shareyou 2020. 11. 15. 12:05
반응형

Eclipse (Helios)에서 Project Lombok이 작동하도록 할 수 없음


여기 http://projectlombok.org/ 튜토리얼을 따랐습니다 .

그러나 가져 오기를 추가하면 @Data아무 일도 일어나지 않습니다.

이클립스 헬리오스에서 작동합니까?


추가 했습니까

-vmargs
...
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar

당신의 eclipse.ini에 ?

프로젝트에서 사용하는 라이브러리에 lombok.jar를 추가했다면 Eclipse Helios에서 잘 작동하기 때문입니다.

대체 텍스트


Ian Tegebo댓글 에서 다음같이 언급 합니다.

간단한 "다시 시작"으로는 변경된 vmargs를 선택하는 데 충분하지 않았습니다.
명시 적으로 종료 한 다음 다시 시작해야했습니다 .


chrisjleu주석 에서 언급합니다 .

사용자 정의 된 Eclipse Helios (3.6+) 배포판을 실행하는 경우 lombok.jarvm인수 에서 전체 경로를 사용해야 할 수 있습니다 .
자세한 내용은 commit b47e87f 를 참조하십시오.

boolean fullPathRequired = IdeFinder.getOS() == EclipseFinder.OS.UNIX || System.getProperty("lombok.installer.fullpath") != null;

lombok.jar을 라이브러리에 추가해야 할뿐만 아니라 lombok jar를 두 번 클릭하거나 명령 줄에서 실행하여 설치해야합니다 java -jar lombok.jar. 그러면 멋진 설치 화면이 표시됩니다. Eclipse 설치를 선택하고 설치하십시오.

나중에 설치 프로그램이 eclipse.ini를 올바르게 수정했는지 확인할 수 있습니다.

-vmargs
...
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar

Eclipse가 이미 실행 중이라면 Eclipse를 종료하고 다시 시작해야합니다. (파일 / 다시 시작만으로는 충분하지 않습니다)

바로 가기를 사용하여 Eclipse를 시작하는 경우, 하나 거기에 담긴 명령 줄 인수 없거나 수동으로 추가되었는지 확인 -javaagent:lombok.jar -Xbootclasspath/a:lombok.jar후 어딘가에 -vmargs.

최신 버전의 Lombok은 About Eclipse 화면에도 한 줄을 추가합니다. Lombok이 활성화되어 있으면 'Lombok v0.11.6 "Dashing Kakapo"가 설치되어있는 줄을 찾을 수 있습니다. http://projectlombok.org/ '버튼 줄 바로 위에 있습니다.

어떤 이유로 일반적으로 사용자 정의 된 Eclipse 빌드와 관련된 경우 전체 경로를 사용해야하는 경우 명령 줄에서 설치 프로그램에 지시 할 수 있습니다.

java -Dlombok.installer.fullpath -jar lombok.jar


lombok을 추가하고 eclipse 또는 spring 도구를 다시 시작한 후에도 내 프로젝트는 여전히 getter 및 setter를 인식하지 못했습니다. 사방에 빨간색 마커!

해결책 : 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 Maven으로 이동하여 프로젝트 업데이트를 선택합니다.

몇 시간 동안 임의의 솔루션을 검색하고 시도한 후 이것이 저에게 도움이 된 유일한 솔루션이라는 것을 알게되었습니다.

여기에 이미지 설명 입력


다음 단계를 따르십시오 :-lombok jar가 이미 Eclipse에서 종속성으로 추가 된 경우 project's lib folder > Locate Lombok.xx.jar > Right Click on Jar> Run as Java Application> This will launch Lombok screen as below:-여기에 이미지 설명 입력

다음으로을 클릭하십시오 "Specify location" > And specify location of "Eclipse.ini" file.(Eclipse neon on Mac osX has it at -> "<Eclipse_installation_path>/jee-neon/Eclipse.app/Contents/Eclipse/Eclipse.ini").

그런 다음 Eclipse 및 Clean 빌드 프로젝트를 다시 시작하십시오.

이것은 나를 위해 일했습니다.


eclipse 설치 폴더에서 직접 eclipse.exe를 시작하는 경우에만이 작업을 수행 할 수 있습니다. eclipse.exe를 실행하기 전에 일부 초기 JAVA_HOME 및 maven 매개 변수를 설정하는 명령 파일을 사용하면 작동하지 않고 정확히 동일한 프로젝트에서 컴파일러 오류가 발생합니다.


Eclipse에서 Project-> Clean을 수행하여 클래스가 재 컴파일되었는지 확인하는 것을 잊지 마십시오.


Remenber run lombok.jar as a java app, if your using windows7 open a console(cmd.exe) as adminstrator, and run C:"your java instalation"\ java -jar "lombok directory"\lombok.jar and then lombok ask for yours ides ubication.


I ran into this problem due to the missing:

-vmargs -javaagent:lombok.jar -Xbootclasspath/a:lombok.jar

as well. What is not explicitly said neither here nor in the Lombok popup message, and was not obvious to me as someone who never before had to fiddle with the eclipse.ini, is that you are NOT supposed to add that line, but instead add the last two parts of that line after the first part, which is already in the eclipse.ini file. To better illustrate, the end of the file should look something like this (bold is what matters for Lombok, the rest might be different for you):

-vm
C:/Program Files/Java/jdk1.7.0_02/bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar


This sometimes does not work if Eclipse is on one of those strange default windows paths (e.g. c:/Program files (86)/Eclipse).

In that case, do as above, then move the lombok jar to a cleaner path without spaces and braces (e.g. c:\lombok\lombok.jar) and modify eclipse.ini accordingly.


If you are using windows xp and eclipse juno then it should be like this in order

-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar
-Xms40m
-Xmx512m

I could not install lombok.jar on my MacBook Pro because of the version of Java. I had to downgrade to Java 1.6 to install and then I reused Java 1.7 when the installation worked !

You can see the different JVM installed on your machine here : /System/Library/Java/JavaVirtualMachines


  1. Copy the Lombok jar into your eclipse based IDE (Eclipse/STS etc-) install folder

    • note that the install folder is the folder that has the .ini file for your IDE
    • if you use Maven to pull in the jar, then get it from your m2 repository
    • cp ~/.m2/repository/projectlombork/lombork-1.x.jar /path/to/IDE/lombok.jar
  2. Edit the .ini file in the install folder of your IDE and add the following lines below -vmargs.

    • -javaagent:lombok.jar -Xbootclasspath/a:lombok.jar
    • note that the jar should be in the same folder as the .ini file and the name of the jar lombok.jar
  3. Restart your IDE and rebuild/maven-update your project


I had similar issue on MacBook Pro, I just followed the below link and issue got resolved. https://projectlombok.org/setup/eclipse

Steps followed:-

  • Download the lombok.jar
  • Double click on this jar
  • This jar will try to find the eclipse installed on the machine, but in my case it was not able to identify the eclipse though I installed on it, this could be due to softlink to the eclipse path.
  • I just specified the location of the eclipse ini file by clicking "Specify location" button
  • This jar automatically updated the entry in eclipse.ini file for javaagent
    • I added the same jar to the classpath of the project in the eclipse
    • Restarted my eclipse

I searched for lomob.jar in .m2 repo. Once you double click it -> Search eclipse.exe and select it. After lombok will make the required changes. Explicitly quit eclipse -> it should be fixed by now. If not do a maven Update.


I am on Eclipse Neon, and after following the above steps, it still didnt work. import lombok.Data; was not being recognized.

After about an hour of looking around, i switched the version to 1.16.14 and it worked.

Now my thought is, whether the 1 hour spent will be a good investment for long term :-)


Eclipse Oxygen - after installation of Lombok according to the process described on the Lombok page, still could not use @Log annotation.

Solution : Project --> Properties - Enable annotation processing


Just faced this issue (compiler errors for generated getters) and none of the proposed solutions helped.

Setup: Eclipse Oxygen (32bit), SAP_JVM (32bit), Lombok 1.16.18 (Eclipse plugin properly installed).

매력처럼 작동하는 평범한 새 테스트 프로젝트를 만들었습니다. 나중에 실패한 프로젝트를 삭제하고 Github 저장소에서 다시 확인하여 오류를 수정했습니다. 작업 공간에서 프로젝트를 삭제하고 다시 가져 오는 것만으로는 도움이되지 않았습니다.

참고 URL : https://stackoverflow.com/questions/3418865/cannot-make-project-lombok-work-on-eclipse-helios

반응형