Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple languages used in one eclipse project

I was wondering whether it was possible for projects in Eclipse to have multiple languages associated with them, specifically PHP and Java. The purpose of this is that I'd like a common 'properties' file for the two projects.

If instead there's a way to hold a relative reference to a file so that both projects can reference the properties file, that will work too.

like image 293
tipu Avatar asked Apr 18 '10 01:04

tipu


People also ask

Can we use multiple languages in eclipse?

Eclipse is one of the most popular IDEs for coding in Java, but, as it turns out, it can be used for different languages, including C, C++, and even Python! In this how-to article, we will learn how to get Python up and running in Eclipse with the help of the Eclipse Marketplace!

How do I use multiple languages in eclipse?

In Eclipse, use the menu Help -> Install new software. Choose "All available sites" in the combo box, wait a moment and then you can explore some other available plugins and languages. Depending on your version of Eclipse, you might also have a menu item Help -> Eclipse Marketplace.


1 Answers

Part one of the question

whether it was possible for projects in Eclipse to have multiple languages associated with them, specifically PHP and Java

No, a project in eclipse is language dependent. You could technically write some source in another language and then use another build method to compile from the secondary language - Not recommended !!!

For the second part of the question ...

Common Property files

Create another project and in that project put a java properties file. Have both projects (Java and PHP) read the property file from here (In Java just add where you put the file as part of the classpath) In PHP use this Java properties reader If you are careful on how you write the Java properties file you could also use parse_ini_file

like image 127
Romain Hippeau Avatar answered Oct 13 '22 01:10

Romain Hippeau