Development Tip

Eclipse / Java 코드 완성이 작동하지 않음

yourdevel 2020. 10. 3. 12:06
반응형

Eclipse / Java 코드 완성이 작동하지 않음


일부 플러그인 (noteable, EPIC, Clearcase, QuantumDB, MisterQ)을 사용하여 Eclipse 3.4.2를 다운로드하고 압축을 풀고 설정했습니다.

이제 Java 프로젝트를 편집 할 때 코드 완성이 작동하지 않습니다. 입력 String.하고 ctrl+를 누르면 space팝업에 "기본 제안 없음"이 표시되고 하단의 상태 표시 줄에 "사용 가능한 완료 없음"이 표시됩니다.

어떤 아이디어?


' ' 의 기본 옵션복원 해보십시오.Windows > Preferences > Java > Editor > Content Assist > Advanced

이 환경 설정 화면에 표시되는 데이터 유형의 예이지만 현재 가지고있는 데이터가 반드시 필요한 것은 아닙니다.

일식 컨텐츠 지원 설정

( 블로그 게시물 "Content Assist Duplicates in Eclipse (Mylyn)"의 Vadim 에서 : 중복 된 Mylyn 항목이있는 경우 이름에 " "가 포함되지 않은 중복 항목 선택 취소 )
(Mylyn)

이클립스 도움말 페이지는 복원 할 기본 목록을 정의합니다 :

'기본'컨텐츠 지원 목록에 포함 된 제안 유형을 선택하십시오 .

  • 기타 Java 제안,
  • SWT 템플릿 제안,
  • 템플릿 제안,
  • 유형 제안

다른 사람이 Google에서 이것을 발견 할 경우를 대비하여 여기에 답변을 추가하고 있습니다. 같은 증상; 다른 문제. 저에게는 유형 캐시가 손상되었습니다.

에서 http://mschrag.blogspot.co.nz/2009/01/open-type-cant-find-your-class.html

  • Eclipse 종료
  • workspace / .metadata / .plugins / org.eclipse.jdt.core로 이동합니다.
  • * .index 및 savedIndexNames.txt 제거
  • Eclipse를 다시 시작하고 Ctrl + T에서 잘못된 유형을 검색하십시오. 인덱스가 다시 작성됩니다.

누군가 여기에 와서 자동 완성 기능을 활성화하려면

Preferences -> Java -> Editor -> Content Assist.

그런 다음 자동 활성화 섹션에서 Java 용 자동 활성화 트리거 를 입력합니다.

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._

여기에 이미지 설명 입력


IBus 플러그인이 활성화 된 Xfce +를 실행하는 경우 키보드 단축키 충돌이있을 수 있습니다.

내 블로그에 대한 자세한 정보보기 : http://peter-butkovic.blogspot.de/2013/05/keyboard-shortcut-ctrlspace-caught-in.html

업데이트 :

@nhahtdh의 의견에서 제안한대로 직접 답변 할 수있는 몇 가지 정보를 추가합니다. Xfce의 IBus 플러그인은 기본적으로 키보드 레이아웃 전환을 위해 단축키 Ctrl+를 사용합니다 Space. 변경하려면 옵션으로 이동하여 원하는대로 변경하십시오.


프로젝트의 라이브러리를 확인하십시오. 동일한 클래스를 사용할 수있는 두 개의 jar 파일을 포함하거나 코드의 한 클래스를 두 개의 jar 파일에서 참조 할 수 있다고 말할 수 있습니다. 이 경우 eclipse는 완전히 혼란스러워 코드 지원을 중단합니다.

이를 확인하는 더 좋은 방법은 지원이 작동하지 않는 파일로 이동하여 모든 가져 오기에 주석을 추가하는 것입니다. 가져 오기를 하나씩 추가하고 코드 지원이 작동하는지 여부를 각 가져 오기에서 확인하는 것입니다. 중복 참조가있는 클래스를 쉽게 찾을 수 있습니다. .


이것들 중 어느 것도 나를 위해 일하지 않았습니다.

I was experiencing this issue in only once particular class. What finally worked for me was to delete the offending class and recreate it. Problem solved... mystery not so much!


If you have installed Google Toolbar for IE, may be you can face the same problem. Because, the toolbar capture the shortcut ctrl+Space.


I faced this problem, and spent hours trying to figure out the issue. tried to follow the steps mentioned in the different answers above, the solution I found is on the same lines as Mona suggested, but slightly different. Tried to add as a comment to Mona's answer but no option was available. Issue with my eclipse was, classpath somehow got corrupted and all the jars and dependent projects were missing. after taking the latest .classpath from repository it worked fine.


I had this problem and like @Marc, only on a particular class. I discovered that I needed to designate Open With = Java Editor. As a Eclipse newbie I hadn't even realized that I was just using a plain editor.

In the package explorer, right-click the file and chose "Open With".


I also face this issue but it is resolved in different way. Steps that I follow may be helpful for others.

  1. Right click on project (the one you are working on)
  2. Go to Properties > Java Build Path > JRE System Library
  3. Click Edit... on the right
  4. Choose the JRE 7

Once you have you configuration checked and completion is still not working:

  • make sure you have the right directory structure.

Do you see the right icon beside the file?:

여기에 이미지 설명 입력

It will tell you how the file will be treated by Eclipse:

여기에 이미지 설명 입력

I am posting this answer as I had that story with with Maven webapp artifact. By default Maven-WebApp does not create folder for sources and I put my Java into resources, wondering for 5 minutes what was going on... :)


Maybe this helps other people who come across the same issue.

My setup: old Gradle project (version Gradle 2.12) made by someone else, imported using the Gradle Import Wizard into STS (Eclipse Oxygen.2 (4.7.2)).

Code completion did not work either (and I still have hollow Js at the Java files), but at least I got the code completion to work by doing:

  • right click on the project folder > Properties > Gradle > Configure Workspace Settings > Java > Editor > Content Assist > Advanced
  • check "Java Proposals in upper window.
  • 2x Apply & Close

Check that you did not filter out many options inside the Window > Preferences > Java > Appearance > Type Filters

Items in this list will not be appear in quick fix, be autocompleted, or appear in other various places like the Open Type dialog.


Another solution which worked for me is to go to Java--> Appearence --> Type Filters and do disable all여기에 이미지 설명 입력


In my case, Intellisense had only disappeared in a few classes in one project. It turned out this was because of a missing library on the build path (although it worked previously).

So definitely check all the errors or problems in Eclipse and try to find if a library may be missing


I ran into this and it ended up being I was opening the file with the text editor and not the java editor.

I wanted to comment on https://stackoverflow.com/users/607470/elroy-flynn response but the add comment only works after I have a rating of 50? not sure WTF that is...

Thanks, Tom


For me the issue was a conflict between several versions of the same library. The Eclipse assist was using an older version than maven.

I had to go to the .m2 directory and delete the unwanted lib version + restart eclipse.


I experience problems on Eclipse Neon when editing a file which does not belong to the project directory. When I copy the same file to the project root directory, not even to the src directory, the completion starts working.

When the file is opened from a different directory, only completion for JRE works. That is for example: java. completes, but junit. does not.


Just in case anyone got to a desperate point where nothing works... It happened to us that the content assist somehow shrunk so no suggestion was shown, just the "Press Ctrl+Space for non-Java..." could be seen. So, it was just a matter of dragging the corner of the content assist to enlarge the pop-up.

I know, embarrassing. Hope it helps.

Note: this was an Ubuntu server with Xfce4 using Eclipse Oxygen.


For those who use the latest 3-19 eclipse build:

It just happened to me when upgrading from Oxygen to 3-19 eclipse version, so I assume the auto-complete feature does not migrated correctly during the upgrade process.

나를 위해 일한 유일한 솔루션은 새 이클립스 작업 공간을 만들고 프로젝트를 가져 오는 것입니다. 몇 분 정도 걸릴 수 있지만 그만한 가치가 있습니다. 다른 솔루션에 소요 된 시간과 비교하면 ...

참고 URL : https://stackoverflow.com/questions/908489/eclipse-java-code-completion-not-working

반응형