5

I have joined a project where the application being worked on involves Java, C, and C++ code with some JNI. Up until now, development was done in Linux from the terminal with a messy recursive makefile structure. Recently, I have been importing this code into an IDE (Eclipse) and was wondering something. Is it best to have one project in Eclipse containing the Java code and another separate project for the C/C++ code or everything in one Eclipse project? Why or why not? What would you recommend as the best way to achieve whichever option you suggest?

THE DOCTOR
  • 4,399
  • 10
  • 43
  • 64

3 Answers3

2

I have single project in Eclipse which mainly use C/C++ code and additional scripting languages - lua, python, bash-scripting and some pieces of java. Build system - makefile, but currently integrate scons build system and remove makefiles trash. So, Eclipse is good and you don't need to create separate projects, you can create all in one project.

Reddy
  • 943
  • 6
  • 12
  • 21
1

I would recommend researching the option of mavenizing your projects. Possibly you can create a multimodule project with some modules as java projects and others as C/C++. Java projects in Maven work out of the box, with C/C++ you can have a look here: Using Maven for C/C++ projects. You can then use your IDE (Eclipse, Netbeans) to execute maven goals. I haven't done it, its just an idea and seems doable.

Community
  • 1
  • 1
Kris
  • 5,714
  • 2
  • 27
  • 47
  • What makes Maven advantageous over other solutions? – THE DOCTOR Feb 03 '12 at 16:04
  • 1
    @THEDOCTOR Maven support version checking, issue libraries detection, among others things. Imagine someone gives you some code and to compile it there are necesary several libraries, how do you know exactly which ones are the exactly version needed? Also, how you check which version best suit other library version for other vendor o even better, how do you know which version of one doesn't make conflicts with the others... Solution MAVEN. – crsuarezf Feb 03 '12 at 16:33
0

Actually compilation of java is already separate from c/c++. You are just calling separately gcc and javac in makefile. So in eclipse if you point your workspace to your java source code, you can use Eclipse IDE as an great editor and for compilation. You can again compile your code in makefile or use generated class files of eclipse.

Half Diminished
  • 193
  • 1
  • 11