Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » how to share a project Windows<->Mac?
how to share a project Windows<->Mac? [message #258296] Mon, 26 January 2009 21:30 Go to next message
Eclipse UserFriend
Originally posted by: dsb.not.here

I have what I'd think is a fairly common situation: an Eclipse Java
project maintained under source control and worked on by a team, with
some team members using Windows and the rest Macs. Unfortunately this
leads to a problem, despite the general cross-platform nature of both
Java and Eclipse.

When the project is created on Windows its .classpath file has the
following line:

<classpathentry kind="con"
path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/jre5 "/>

whereas when the logically identical project is made on MacOS X it says:

<classpathentry kind="con"
path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.launching.macosx.MacOSXType/JVM
1.5.0 MacOS X Default"/>

Notice the literal references to MacOS. There's a similar one in the
..settings/org.eclipse.jst.common.project.facet.core.prefs file, e.g.:

classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\: org.eclipse.jdt.internal.launching.macosx.MacOSXType\:\:JVM\
1.5.0\ MacOS X Default/owners=jst.java\:5.0

In all other respects the projects are identical whether created on
Windows or Mac, but this one difference essentially makes it impossible
to maintain the .classpath file under source control and still develop
on both platforms.

I've tried creating an alias JRE definition with the same name on both
platforms and hand-tweaking .classpath to refer to it, but nothing so
far has resulted in a project which builds on both platforms. Has
anybody solved this?

Thanks,
DSB

PS Eclipse Ganymede for Java EE and trying to stick with Java 5 for now.
Re: how to share a project Windows<->Mac? [message #258299 is a reply to message #258296] Tue, 27 January 2009 01:27 Go to previous messageGo to next message
Eclipse UserFriend
"David Boyce" <dsb@not.here> wrote in message
news:gllrjl$mcs$1@build.eclipse.org...
>I have what I'd think is a fairly common situation: an Eclipse Java project
>maintained under source control and worked on by a team, with some team
>members using Windows and the rest Macs. Unfortunately this leads to a
>problem, despite the general cross-platform nature of both Java and
>Eclipse.
>
> When the project is created on Windows its .classpath file has the
> following line:
>
> <classpathentry kind="con"
> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/jre5 "/>
>
> whereas when the logically identical project is made on MacOS X it says:
>
> <classpathentry kind="con"
> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.launching.macosx.MacOSXType/JVM
> 1.5.0 MacOS X Default"/>

I think something funky is going on on your Macs.

First data point: I just tried creating a plain Java project and a plug-in
project on Eclipse 3.4.1 on my Mac. In both cases, the .classpath was the
same as on Windows: for the plain Java project,
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
and for the plug-in project,
<classpathentry kind="con"
path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/J2SE-1.5 "/>

Second data point: looking at Eclipse SDK plug-in projects from the Eclipse
CVS repository, they are all "Windows style" but I know that there are
plenty of Mac developers also working on Eclipse Project plugins.

Third data point: my team at my non-Eclipse day job also has both Mac and
Windows, and I don't think we've ever run into this kind of problem. That
said, for the most part we don't check the Eclipse artifacts into the
repository, rather we've got a tool that builds the Eclipse artifacts for
each person individually, but I'm pretty sure we have some projects shared.


So, I'm not sure what's going on on the Macs, but that's where to look.
Does the Windows-style entry work on the Mac?
Re: how to share a project Windows<->Mac? [message #258324 is a reply to message #258296] Tue, 27 January 2009 10:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 1/26/2009 9:30 PM, David Boyce wrote:
> I have what I'd think is a fairly common situation: an Eclipse Java
> project maintained under source control and worked on by a team, with
> some team members using Windows and the rest Macs. Unfortunately this
> leads to a problem, despite the general cross-platform nature of both
> Java and Eclipse.

When creating or configuring the projects, make sure to use an Execution
Environment (EE) instead of selecting a JRE - this is exactly why EEs
were introduced, to avoid this kind of situation.

Hope this helps,
Eric


>
> When the project is created on Windows its .classpath file has the
> following line:
>
> <classpathentry kind="con"
> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/jre5 "/>
>
>
> whereas when the logically identical project is made on MacOS X it says:
>
> <classpathentry kind="con"
> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.launching.macosx.MacOSXType/JVM
> 1.5.0 MacOS X Default"/>
>
> Notice the literal references to MacOS. There's a similar one in the
> .settings/org.eclipse.jst.common.project.facet.core.prefs file, e.g.:
>
> classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\: org.eclipse.jdt.internal.launching.macosx.MacOSXType\:\:JVM\
> 1.5.0\ MacOS X Default/owners=jst.java\:5.0
>
> In all other respects the projects are identical whether created on
> Windows or Mac, but this one difference essentially makes it impossible
> to maintain the .classpath file under source control and still develop
> on both platforms.
>
> I've tried creating an alias JRE definition with the same name on both
> platforms and hand-tweaking .classpath to refer to it, but nothing so
> far has resulted in a project which builds on both platforms. Has
> anybody solved this?
>
> Thanks,
> DSB
>
> PS Eclipse Ganymede for Java EE and trying to stick with Java 5 for now.
Re: how to share a project Windows<->Mac? [message #258328 is a reply to message #258299] Tue, 27 January 2009 10:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dsb.not.here

Walter Harley wrote:
> I think something funky is going on on your Macs.
>
> First data point: I just tried creating a plain Java project and a plug-in
> project on Eclipse 3.4.1 on my Mac. In both cases, the .classpath was the
> same as on Windows:

Thanks very much for this. I'm going to research the suggestion by Eric
Rizzo next but would you mind helping with one more data point? On
closer examination, the projects in question were created by the
"Dynamic Web Project" wizard (File>New>Other>Web). What does your
initial classpath file look like after you complete that wizard? Mine is
as follows:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.launching.macosx.MacOSXType/JVM
1.5.0 (MacOS X Default)"/>
<classpathentry kind="con"
path=" org.eclipse.jst.server.core.container/org.eclipse.jst.server .tomcat.runtimeTarget/Apache
Tomcat v6.0"/>
<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>

Where "JVM 1.5.0 (MacOS X Default)" is the default JRE out of the box.
I'm not sure what the "launching" stuff means but it suggests the
problem may only arise with a project bound to a server environment.

> So, I'm not sure what's going on on the Macs, but that's where to look.
> Does the Windows-style entry work on the Mac?

Good question. I believe the answer is no but will check one more time.

DSB
Re: how to share a project Windows<->Mac? [message #258339 is a reply to message #258328] Tue, 27 January 2009 12:22 Go to previous messageGo to next message
Eclipse UserFriend
"David Boyce" <dsb@not.here> wrote in message
news:glnaji$le5$1@build.eclipse.org...
> Walter Harley wrote:
>> I think something funky is going on on your Macs.
>>
>> First data point: I just tried creating a plain Java project and a
>> plug-in project on Eclipse 3.4.1 on my Mac. In both cases, the
>> .classpath was the same as on Windows:
>
> Thanks very much for this. I'm going to research the suggestion by Eric
> Rizzo next but would you mind helping with one more data point? On closer
> examination, the projects in question were created by the "Dynamic Web
> Project" wizard (File>New>Other>Web). What does your initial classpath
> file look like after you complete that wizard?

Ah, that's very interesting.

I can't actually answer that, because I'm using JDT, not WTP - I don't do
web or J2EE development.

I wonder if this issue is specific to WTP. You might want to try posting on
the eclipse.webtools group, or searching the WTP component in Bugzilla, to
see if anyone's got any insights.
Re: how to share a project Windows<->Mac? [message #258347 is a reply to message #258324] Tue, 27 January 2009 18:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dsb.not.here

Eric Rizzo wrote:
> On 1/26/2009 9:30 PM, David Boyce wrote:
>> I have what I'd think is a fairly common situation: an Eclipse Java
>> project maintained under source control and worked on by a team, with
>> some team members using Windows and the rest Macs. Unfortunately this
>> leads to a problem, despite the general cross-platform nature of both
>> Java and Eclipse.
>
> When creating or configuring the projects, make sure to use an Execution
> Environment (EE) instead of selecting a JRE - this is exactly why EEs
> were introduced, to avoid this kind of situation.

This seems to have done the trick. There are a couple of minor glitches
- first, I can't seem to make an EE the default but rather have to
create a project and then fix the classpath to use the EE. Second, I get
a persistent warning on Windows to the effect that the execution
environment doesn't "precisely" match any known JRE[*]. But despite the
warning, the same project now works on both Windows and Mac, so thanks!

-DSB

[*] Come to think of it, this may be because the Windows machine on
which I tested has only Java 6 installed. Eclipse was happy to suggest
it for the "J2SE-5" EE so I figured it would be used in backward
compatibility mode, but I should try installing and using an actual Java
5 JRE before jumping to any conclusions.
Re: how to share a project Windows<->Mac? [message #258355 is a reply to message #258347] Wed, 28 January 2009 04:35 Go to previous message
Eclipse UserFriend
Originally posted by: mauro.molinari.cardinis.com

David Boyce ha scritto:
> [*] Come to think of it, this may be because the Windows machine on
> which I tested has only Java 6 installed. Eclipse was happy to suggest
> it for the "J2SE-5" EE so I figured it would be used in backward
> compatibility mode, but I should try installing and using an actual Java
> 5 JRE before jumping to any conclusions.

Yes, you should install a JRE 5. Although the JRE 6 is
"retro-compatible", the libraries (API) are different. This is the
reason of the "not perfect match" warning.

Mauro.
Previous Topic:Error remotely debugging: VMDisconnectedException: Got IOException
Next Topic:[apt] Preserving result between processor runs
Goto Forum:
  


Current Time: Fri Apr 18 11:41:09 EDT 2025

Powered by FUDForum. Page generated in 0.04263 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top