tags:

views:

365

answers:

2

hi,

I have a directory which has both java/c++ code (they are in different sub-directories, multiple of them). How to open a eclipse java and a c++ project point to the same root directory? eclipse won't let me, saying something like 'there is a project exists in the same location'

Thank you.

A: 

In java project build path settings, you can point to external folders to build from. "Link additional source: use this if you have a folder in the file system that should be used as additional source folde"

So you could have your C++ project pointing to the main folder, then create a java project in a different dir and then use the above mechanism to compile all the java source. Not a great solution, since you have two projects and two different working dirs.

What I can tell you for sure, is that you can only have one project per location on the file system, since eclipse creates a whole bunch of metadata dirs etc..

My only other thought is if you could create a project that builds Java and C++. Eclipse has the concept of builders and natures. Somehow you need a project with Java and C++ natures/builders...

I did a quick google and it looks like this post covers both of these options: http://lorinc.blogspot.com/2006/10/how-to-mix-java-and-c-code-in-singe.html

RefuX
A: 

I'm not sure if I understood correctly
You have:

"workspace\project\" which contains both projects together?
I don't think you can, since eclipse creates some files (such as .project) for every project.. if both share the same directory, then eclipse would need two files, one name, one location.

I suggest moving the C project into some other folder.

Hugo