Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Import IntelliJ project into Eclipse(problem with package name mapping)
Import IntelliJ project into Eclipse [message #780940] Fri, 20 January 2012 04:30 Go to next message
Slava Durin is currently offline Slava Durin
Messages: 3
Registered: January 2012
Junior Member
Hi guys.
I'm going to move from IntelliJ idea to Eclipse.

But I can't solve a problem with package names and physical location of files.

In IntelliJ idea I am able to map any folder to any package names
so I am able to create any hierarhy of files.

e.g. I have 2 folders and 1 java file like this
my/
    | 
    folder/
          |         
          +-MyClass.java



and I can map it to the package named "com.anypackagename".

Is it possible to do something like this in Eclipse?

I managed to export my project from IntelliJ Idea and import in Eclipse,
but Eclipse doesn't like package names because those java files have different physical location.

Appreciate any help.
Re: Import IntelliJ project into Eclipse [message #780942 is a reply to message #780940] Fri, 20 January 2012 04:42 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
Registered: July 2009
Senior Member
On 1/20/2012 10:00 AM, Slava Durin wrote:
> Is it possible to do something like this in Eclipse?
No.

--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
Re: Import IntelliJ project into Eclipse [message #782382 is a reply to message #780940] Mon, 23 January 2012 16:20 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 20.01.2012 05:30, Slava Durin wrote:
> Hi guys.
> I'm going to move from IntelliJ idea to Eclipse.
>
> But I can't solve a problem with package names and physical location
> of files.
>
> In IntelliJ idea I am able to map any folder to any package names so I
> am able to create any hierarhy of files.
>
> e.g. I have 2 folders and 1 java file like this
>
> my/
> | folder/
> | +-MyClass.java
>
>
>
> and I can map it to the package named "com.anypackagename".
>
> Is it possible to do something like this in Eclipse?
Deepak is right regarding the import. However, you can manually
configure it - might be some work though, depending on how many such
packages you have. Let me know if that's an option and I can give more
details if needed.

Dani
>
> I managed to export my project from IntelliJ Idea and import in Eclipse,
> but Eclipse doesn't like package names because those java files have
> different physical location.
>
> Appreciate any help.
Re: Import IntelliJ project into Eclipse [message #782391 is a reply to message #782382] Mon, 23 January 2012 16:35 Go to previous messageGo to next message
Slava Durin is currently offline Slava Durin
Messages: 3
Registered: January 2012
Junior Member
Actually there are 3 java packages but a few hundreds java files that are under different folders.

> However, you can manually configure it

Could you explain please how it can be done manually ?

Thanks
Re: Import IntelliJ project into Eclipse [message #782409 is a reply to message #782391] Mon, 23 January 2012 16:56 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 23.01.2012 17:35, Slava Durin wrote:
> Actually there are 3 java packages but a few hundreds java files that
> are under different folders.
>
>> However, you can manually configure it
>
> Could you explain please how it can be done manually ?
For each leave folder on disk you need to create the structure with
virtual folders and then create a link for each file.

For the example given by you this would mean:

1. choose (or create) a source folder (can also be the project) but must
be a real folder located on the Java Build path
2. select that folder
3. File > New > Folder
4. enter "com" as name
5. click the 'Advanced' button
6. select 'Folder is not located in the file system (Virtual Folder)'
7. click 'Finish'
8. select that new folder
9. File > New > Folder
10. enter "anypackagename" as name
11. click the 'Advanced' button
12. select 'Folder is not located in the file system (Virtual Folder)'
13. click 'Finish'
14. on the file system (outside Eclipse) go to my/folder
15. select all the files and DnD them onto the 'anypackagename' folder

Dani
>
> Thanks
Re: Import IntelliJ project into Eclipse [message #782414 is a reply to message #782391] Mon, 23 January 2012 16:56 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 23.01.2012 17:35, Slava Durin wrote:
> Actually there are 3 java packages but a few hundreds java files that
> are under different folders.
>
>> However, you can manually configure it
>
> Could you explain please how it can be done manually ?
For each leave folder on disk you need to create the structure with
virtual folders and then create a link for each file.

For the example given by you this would mean:

1. choose (or create) a source folder (can also be the project) but must
be a real folder located on the Java Build path
2. select that folder
3. File > New > Folder
4. enter "com" as name
5. click the 'Advanced' button
6. select 'Folder is not located in the file system (Virtual Folder)'
7. click 'Finish'
8. select that new folder
9. File > New > Folder
10. enter "anypackagename" as name
11. click the 'Advanced' button
12. select 'Folder is not located in the file system (Virtual Folder)'
13. click 'Finish'
14. on the file system (outside Eclipse) go to my/folder
15. select all the files and DnD them onto the 'anypackagename' folder

Dani
>
> Thanks
Re: Import IntelliJ project into Eclipse [message #782423 is a reply to message #782391] Mon, 23 January 2012 16:56 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 23.01.2012 17:35, Slava Durin wrote:
> Actually there are 3 java packages but a few hundreds java files that
> are under different folders.
>
>> However, you can manually configure it
>
> Could you explain please how it can be done manually ?
For each leave folder on disk you need to create the structure with
virtual folders and then create a link for each file.

For the example given by you this would mean:

1. choose (or create) a source folder (can also be the project) but must
be a real folder located on the Java Build path
2. select that folder
3. File > New > Folder
4. enter "com" as name
5. click the 'Advanced' button
6. select 'Folder is not located in the file system (Virtual Folder)'
7. click 'Finish'
8. select that new folder
9. File > New > Folder
10. enter "anypackagename" as name
11. click the 'Advanced' button
12. select 'Folder is not located in the file system (Virtual Folder)'
13. click 'Finish'
14. on the file system (outside Eclipse) go to my/folder
15. select all the files and DnD them onto the 'anypackagename' folder

Dani
>
> Thanks
Re: Import IntelliJ project into Eclipse [message #782430 is a reply to message #782423] Mon, 23 January 2012 17:17 Go to previous message
Slava Durin is currently offline Slava Durin
Messages: 3
Registered: January 2012
Junior Member
Thanks a lot Dani, it is the first thing I'll try in the morning
Previous Topic:getAppletContext() In Eclipse IDE?
Next Topic:Find Eclipse java build command
Goto Forum:
  


Current Time: Thu Sep 18 23:56:07 GMT 2014

Powered by FUDForum. Page generated in 0.02565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software