Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store run configuration with project in Eclipse

Tags:

java

eclipse

I'm programming in NetBeans however i like to get used to Eclipse as well. I have a Maven project what i've developed in NetBeans and after importing it compiles fine in Eclipse. I'm using the Run or Debug feature of NetBeans a lot, and it's very comfortable that the run configuration gets stored with the project so i can actually commit it into version control and others can use it as well. Say i have a Java application project which has a main class. To run this, i need to define the correct class path for the exec goal (actually NetBeans automatically does this for me when creating the new project).

In Eclipse i have to define Run configurations which as far as i know gets stored in the workspace but not in the project. Is there any similar feature in Eclipse what i'm looking for?

like image 433
NagyI Avatar asked Dec 24 '11 14:12

NagyI


People also ask

Where are the run configurations stored in Eclipse?

These configrations are located in . metadata/. plugins/org. eclipse.

How do I run a project in Eclipse?

In Eclipse, try Project > Open Project and select the projects to be opened. Show activity on this post. In case you closed multiple projects and trying to re-open all of them then in Project Explorer , select all projects. Go to Project -> Open Project .


1 Answers

Yes - open "Run" then "Run Configurations...", and select your configuration. Click on the last tab, "Common". Under "Save As", choose "Shared File" instead of "Local File".

enter image description here

This dialog is a little confusing. The line next to "Shared File" can only be a path, not a file name - and it defaults to the root path of the current project. Once you hit "Apply", a file named the [Run Configuration Name] + ".launch" is created within that folder. So in my above example, this results in a "/JavaTest/JavaTest.launch" file. This is something that can be comitted to version control.

like image 52
ziesemer Avatar answered Oct 23 '22 18:10

ziesemer