2

The short quetsion:

How do i make only the 'src' folder of an eclipse java project shared across multible computers.

The long quetsion:

One way to have a shared java project across multible computers , is to just drop the project in dropbox and open it with the same IDE in each computer.

The problem in my case comes with the fact that the computers' jvm version varies between java7 and java8, so this approach does not work (compiler error)

Is there a way to share the project in eclipse without sharing the jvm-specific settings?


PS 1: the source code is "compilable" with both versions

PS 2: I am aware of github and i am using it in many cases, but i do not want to use it in this case.

2 Answers 2

2

There are a couple of important things to consider:

  1. Sharing project contents at the filesystem level (that's what effectively Dropbox is in this scenario, a distributed filesystem), is risky and will most likely lead to problems. Think about what would happen when to computers are touching the project files at the same time, or when Dropbox is temporarily unavailable, etc. It could be disastrous and difficult to recover from. This is why scm systems like git, cvs, subversion, etc. were invented in the first place, to manage the complexity of sharing code. Anyone should think twice thrice before doing what you're trying.
  2. If you're determined to share projects (even using proper SCM tools), the concept of Execution Environments (EE) is provided to solve the differing Java installations problem. EEs are an abstraction of a Java version that Eclipse uses to isolate projects from the system/workspace they're loaded into. See this answer for some more details.
  3. You almost always want to share the .class, .project, and .settings (folder). Those files are intended to be shared and portable, and doing so makes life nice when sharing a project.
Sign up to request clarification or add additional context in comments.

3 Comments

I get the feeling that i should forget the dropbox approach. Thanks for your answer
To justify myself, the only one contributing to the project is me. If this was a multi-person project, i wouldn't even consider dropbox. I don't want to create a git project for something so small so this answer: stackoverflow.com/questions/20146646/… is what i was looking for.
I am accepting this answer both for your on-point comments and for the patchy solution in the comments section. Thanks again!
1

The settings of Eclipse (and any other IDE I know of) are stored in the project as special files. In the case of Eclipse, this information is stored in files in the .settings folder and in .classpath.

So no matter what way to share your src folder you choose, if you keep your project structure in your different computers and only share src, you will keep local your settings for the project.

2 Comments

Well i imagine that i if am not sharing '.classpath' file, other problems may arise. For example, when i adding .jar files... From the answers here, i have the feeling that is should forget about the dropbox solution. Thanks for your answer
@Mario Indeed, but then you would have to modify .classpath if you work with external jars anyway. Have a look at E-Riz answer, I believe he is right and EEs might do the trick for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.