이클립스에서 세로 스크롤링이 정말 느려지는 버그가 있습니다.


모든 이클립스에서 발생하는 지는 모르겠으나


ubuntu 14.04에 이클립스 mar 버전에서는 발생했는데요 해결방법을 알아보겠습니다.


1. 터미널 창을 연다


2. sudo로 /etc/profile파일을 연다. (ex sudo vi /etc/profile)


3. 파일의 맨끝에 SWT_GTK3=0 을 추가한다.


4. 파일을 저정하고 재시작한다.


간단한방법인데 저는 이렇게 수정한이후에 한번도 발생하지 않았습니다.


이클립스를 쓰다보면 특정한 상황에서 Project Explorer에 프로젝트가 하나도 없을때가 있습니다.

주로 프로젝트 전체를 복사해서 사용하였을때 발생합니다.


이럴땐 기존프로젝트의 찌꺼기부분을 삭제하고 다시 릴로드를 해주면 해결이 됩니다.


Project Explorer 리로드


찌꺼기 삭제


$ cd ~/Workspace/ybonline/.metadata/.plugins/

$ rm -rf org.eclipse.core.resources



이클립스를 실행합니다.


메뉴에서 file -> import -> General -> Existing Projects into Workspace -> Next를 선택합니다.

Select root directory 를 선택하고 Browse를 선택해 “/home/자신의ID/Workspace/ybonline”를 선택합니다.

Refresh를 선택하고 Finish를 선택하면 프로젝트가 릴로드 됩니다.

가끔 이클립스프로젝트 파일을 복사해서 프로젝트를 열때 프로젝트 자체가 열리지 않으면서

 ...\workspace\.metadata\.log.를 확인하라고 할때가 있습니다.


이때 .log파일을 열어보면 다음과 같은에러가 발생합니다.


Caused by: org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/_project_2' not found.



두가지 방법이 있습니다.


1. snap만 삭제하는방법


$ cd eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources

$ find . -type f -name "*.snap" | xargs rm


2. org.eclipse.core.resources 폴더를 지우고 프로젝트 릴로드 하는방법 ( 확실한 방법 )


$ cd ~/Workspace/.metadata/.plugins/

$ rm -rf org.eclipse.core.resources


메뉴에서 file -> import -> General -> Existing Projects into Workspace -> Next를 선택한다.

Select root directory 를 선택하고 Browse를 선택해 "자신의Workspace”를 선택한다.

Refresh를 선택하고 Finish를 선택하면 프로젝트가 릴로드 된다

이번에는 우분투에 이클립스를 설치해보도록한다.

 

Ubuntu Software Center에서 설치는 가능하지만 특정 버전으로 만 깔려서 최신버전을 설치하기 위해서는

이클립스 사이트에서 다운받아서 설치를 해보도록 한다.

 


0. 개발 하기 위한 기본 환경을 구축한다.


 $ sudo apt-get install build-essential


다음의 7개 패키지가 자동 설치된다.


build-essential

dpkg-dev

g++

g++-4.1

libc6-dev

libstdc++6-4.1-dev

linux-libc-dev



1. JDK가 설치되지 않았다면 설치한다

 

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-jdk7-installer

 

2. 이클립스 홈페이지에서 설치할 버전을 다운로드한다.

 

http://www.eclipse.org/downloads/

 

3.  압축을 푼다

 

$ sudo tar xvfz [eclipse 파일명].tar.gz 혹은 탐색기에서 마우스 오른쪽버튼을 이용해 압축을 푼다.

 

4. 설치한 이클립스를 이동한다. (미리 이클립스를 저장할 폴더에 압축을 풀었다면 굳이 필요가 없다.)

 - 이동을 일반적으로 하는 이유는 이클립스는 설치가 사실 아니라 압축을 풀어서 바로 사용하는 형태이므로

   설치를 원하는 폴더에 MOVE한다.

 

$ sudo mv eclipse ~/program(이동할폴더)

 

5. 링크 걸기

 

$ sudo ln -s ~/program/eclipse /usr/bin/eclipse                         ex)~/program 는 4번에서 이동한 폴더

 

여기까지 하면 기본 설치 완료 이다. 



구글링에서 보면 이클립스 실행시 SWT library를 부를수 없다는 에러가 뜨기도 한다고 한다.

 

이때는 SWT library를 아래와 같이 링크를 걸어주면 된다.

 

32 비트 설치 시,

$ ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

 

64 비트 설치 시,

$ ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

 

 

tar로 설치하면 아이콘이 생성이 안되는데 실행하기 위해서 콘솔에서 사용하기엔 너무 불편하다.

이클립스 실행 아이콘 까지 만들어 보겠다

 

아래 패키지를 설치한다.

 

$ sudo apt-get install gnome-panel

 

아래와 같이 실행한다.

$ gnome-desktop-item-edit --create-new [아이콘을 생성할 위치]

 

ex ) $ gnome-desktop-item-edit --create-new ~/Desktop   --> 데스크 탑에 아이콘 생성

 

다음과 같은 창이 뜨는데 설정을 완료하고 OK를 클릭하면 아이콘이 생성됩니다.

 

Type : Application을 선택

Name : 아이콘 이름

Command: 실행파일 경로

 

스프링 모양의 아이콘을 선택해서 아이콘도 변경할수있습니다

 





 

생성된 아이콘을 실행하면 이제 이클립스가 실행됩니다.

 


이제 C++환경울 구축해본다.


1. 이클립스를 실행한다.


2. ​HELP > Install New Software 를 실행

 

3. http://www.eclipse.org/cdt/downloads.php 에서 CDT 의 최신버전 업데이트 주소를 알수있습니다.

   2014.5.15일 현재 버전은 칼리퍼 입니다. (http://download.eclipse.org/tools/cdt/releases/kepler)


4. add를 선택하고 Name에 이름을 입력하고 Location에 CDT 의 최신버전 업데이트 주소를 입력하고 OK를 클릭합니다.


5. 리스트중에 CDT Main Features는 모두 설치하고 CDT Optional Features는 모두 선택 혹은 필요한것만 선택합니다.


6. next를 클릭하면서 모든 설치를 완료합니다.


이로서 우분투에 개발환경 구축및 c++가능 이클립스 설치를 완료하였습니다.


이클립스 등을 사용해서 컴파일할때 Header를 include하기 위해서 경로를 설정한다.

 

프로젝트 Properites -> C/C++ Build -> Settings 에서

GCC C++ Compiler -> Includes를 선택하고

Include paths에서 설저을 해주는데 여러 개발자가 공유하는 프로젝트의 경우 로컬 경로로 설정한다면

 

작업하는 개발자 마다 자신의 컴퓨터 경로로 수정하여야하는데 이때 간편하게 할수있는 방법이다.

 

한가지 예를 들면

 

워크페이스 경로 : /home/build/project

 

${workspace_loc} ->  /home/build/project

${workspace_loc:/include} ->  /home/build/project/include

 

프로젝트 네임 : AAAA

"${workspace_loc:/${ProjName}/src}" -> /home/build/project/AAAA/src

 

더많은 방법과 자세한 설명은 아래 이클립스 사이트에서 퍼온 자료를 보면  알수있을것이다.

 

 

Variable Name

Description

${workspace_loc}The absolute path on the system's hard drive to Eclipse's workspace directory
${workspace_loc:<resource path>}The absolute path on the system's hard drive to the specified resource. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt if the project's contents directory for MyProject is outside the workspace directory.
${project_loc}The absolute path on the system's hard drive to the currently selected resource's project or to the project being built if the external tool is run as part of a build.
${project_loc:<resource path>}The absolute path on the system's hard drive to the specified resource's project. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject if the project's contents directory for MyProject is outside the workspace directory.
${container_loc}The absolute path on the system's hard drive to the currently selected resource's parent (either a folder or project).
${container_loc:<resource path>}The absolute path on the system's hard drive to the specified resource's parent (either a folder or project). The <resource path> is the full path of the resource relative to the workspace root. For example:${workspace_loc:/MyProject/MyFolder/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFolder if the project's contents directory for MyProject is outside the workspace directory.
${resource_loc}The absolute path on the system's hard drive to the currently selected resource.
${resource_loc:<resource path>}The absolute path on the system's hard drive to the specified resource. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt if the project's contents directory for MyProject is outside the workspace directory.
${project_path}The full path, relative to the workspace root, of the currently selected resource's project or of the project being built if the external tool is run as part of a build.
${container_path}The full path, relative to the workspace root, of the currently selected resource's parent (either a folder or project).
${resource_path}The full path, relative to the workspace root, of the currently selected resource.
${project_name}The name of the currently selected resource's project or of the project being built if the external tool is run as part of a build.
${container_name}The name of the currently selected resource's parent (either a folder or project).
${resource_name}The name of the currently selected resource.
${build_type}The kind of build when the external tool is run as part of a build. The value can be one of "full", "incremental", or "auto". If the external tool is run outside of a build, the value is then "none".

 

Variable Example

Expanded Results

${workspace_loc}c:\eclipse\workspace
${workspace_loc:/MyProject1/MyFile.txt}c:\eclipse\workspace\MyProject\MyFile.txt
${workspace_loc:/MyProject2/MyFile.txt}c:\projects\MyProject2\MyFile.txt
${project_loc}c:\projects\MyProject2
${project_loc:/MyProject1/MyFile.txt}c:\eclipse\workspace\MyProject
${container_loc}c:\projects\MyProject2\MyFolder
${resource_loc}c:\projects\MyProject2\MyFile.txt
${project_path}/MyProject2
${container_path}/MyProject2/MyFolder
${resource_path}/MyProject2/MyFolder/MyFile.txt
${project_name}MyProject2
${container_name}MyFolder
${resource_name}MyFile.txt
${build_type}none


+ Recent posts