открытие проекта из Eclipse в Intellij Idea

135
16 ноября 2019, 13:00

Проект, который был написан и скомпилирован в Eclipse. Работаю в Intellij Idea. Проект клонил с github. Все импорты в проекте из Eclipse. Есть ли какая-то утилита или другой способ, чтобы идея могла с ним работать? Пример:

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.ScrollBar;
Answer 1

Попробуйте добавить зависимости от org.eclipse.swt в pom.xml:

<dependencies>
    <!-- Выберите предпочтительный или переместите предпочтительный вверх: -->
    <!-- https://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.win32.win32.x86_64 -->
    <dependency>
        <groupId>org.eclipse.swt</groupId>
        <artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
        <version>${swt.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.eclipse.maven/org.eclipse.swt.win32.win32.x86 -->
    <dependency>
        <groupId>org.eclipse.swt</groupId>
        <artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
        <version>${swt.version}</version>
        <!-- Чтобы использовать отладочную банку, добавьте эту -->
        <classifier>debug</classifier>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.wso2.wsf/org.eclipse.swt.gtk.linux.86 -->
    <dependency>
        <groupId>org.eclipse.swt</groupId>
        <artifactId>org.eclipse.swt.gtk.linux.x86</artifactId>
        <version>${swt.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.kermeta.eclipse/org.eclipse.swt.gtk.linux.x86_64 -->
    <dependency>
        <groupId>org.eclipse.swt</groupId>
        <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
        <version>${swt.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64 -->
    <dependency>
        <groupId>org.eclipse.swt</groupId>
        <artifactId>org.eclipse.swt.cocoa.macosx.x86_64</artifactId>
        <version>${swt.version}</version>
    </dependency>
</dependencies>

Последние SWT-артефакты для Windows 64 bit:https://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.win32.win32.x86_64

Последние SWT-артефакты для Windows 32 bit: https://mvnrepository.com/artifact/org.eclipse.maven/org.eclipse.swt.win32.win32.x86

Последние SWT-артефакты для Linux 32 bit: https://mvnrepository.com/artifact/org.wso2.wsf/org.eclipse.swt.gtk.linux.86

Последние SWT-артефакты для Linux 64 bit: https://mvnrepository.com/artifact/org.kermeta.eclipse/org.eclipse.swt.gtk.linux.x86_64

Последние SWT-артефакты для MacOS 64 bit: https://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64

В GitHub: https://github.com/eclipse/eclipse.platform.swt.binaries

Answer 2

Не уверен, но попробуй вставить вот это в свой pom.xml:

<dependency>
   <groupId>org.eclipse</groupId>
   <artifactId>swt</artifactId>
   <version>4.6.1</version>
</dependency>

если не используешь Maven - jar файл

Answer 3

Для начала вам необходимо найти библиотеку под вашу архитектуру, у меня есть проект SWT который я запускаю из idea, кроме основной библиотеки используется масса вспомогательных:

org.eclipse.jface_3.3.1.M20070910-0800b
org.eclipse.jface.text_3.5.0
org.eclipse.core.runtime_3.3.100.v20070530
org.eclipse.core.commands_3.3.0.I20070605-0010
org.eclipse.equinox.common_3.3.0.v20070426
org.eclipse.text_3.5.0

Что бы решить возникшие, проблемы совместимости при запуске приложений динамически подключается одна и библиотек(см. ссылку на Google drive), для работы самой ide использую swt-debug.jar.

READ ALSO
Отличие WebApplicatIoninitializer от AbstractAnnotationConfigDispatcherServletInitializer

Отличие WebApplicatIoninitializer от AbstractAnnotationConfigDispatcherServletInitializer

Настроить ServletContext в Spring можно создав класс - конфигурацию и :

137
Ошибка: &ldquo;Cannot resolve symbol support&rdquo;

Ошибка: “Cannot resolve symbol support”

Всё было в порядкеВыгрузил проект из битбакета и при импорте:

134
Attempt to invoke virtual method &#39;char java.lang.String.charAt(int)&#39; on a null object reference

Attempt to invoke virtual method 'char java.lang.String.charAt(int)' on a null object reference

Я хочу реализовать ImageView, который будет менять свой цвет

146