Skip to main content



      Home
Home » Newcomers » Newcomers » Linked resources fails
Linked resources fails [message #242995] Thu, 13 December 2007 02:54 Go to next message
Eclipse UserFriend
Originally posted by: roger.nokes.canterbury.ac.nz

Hi

I am running Eclispe 3.3.0 on Windows XP. I have a set of Java source
files that are used by a number of projects. Currently I have these files
in a separate project. I export the class files as a JAR from this project
and add this JAR as an external JAR library in the build path for all the
projcts that need the classes. This works fine except of course when
debugging the code I can't access the source code in the JAR.

I'd like to access the common source code directly in each project by
linking the folder containing the common source to each project. I find
that I am unable to do this. I choose add folder for the project, click
advanced and select the folder that is the root of the common source code.
Once I click OK Eclipse informs me that it has an internal error and that
the element (folder) cannot be found.

Any ideas of what I'm doing/not doing would be much appreciated.

Roger
Re: Linked resources fails [message #243010 is a reply to message #242995] Thu, 13 December 2007 09:42 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Roger Nokes wrote:
> Hi
>
> I am running Eclispe 3.3.0 on Windows XP. I have a set of Java source
> files that are used by a number of projects. Currently I have these
> files in a separate project. I export the class files as a JAR from this
> project and add this JAR as an external JAR library in the build path
> for all the projcts that need the classes. This works fine except of
> course when debugging the code I can't access the source code in the JAR.
>
> I'd like to access the common source code directly in each project by
> linking the folder containing the common source to each project. I find
> that I am unable to do this. I choose add folder for the project, click
> advanced and select the folder that is the root of the common source
> code. Once I click OK Eclipse informs me that it has an internal error
> and that the element (folder) cannot be found.
>
> Any ideas of what I'm doing/not doing would be much appreciated.

You're missing the notion of project dependencies. Using a linked
resource for this is not at all the intention - linked resources are
intended to allow you to have things in your logical Eclipse project
that are physically located somewhere else on the file system.
All you need to do is make the "other" projects depend on the one with
the common code.
For example, let's say your shared code is in a project named "Common"
and you have another project that needs to use it, named AppA. Open the
project properties for AppA and select the Java Build Path section. On
the Projects tab there you can define that AppA depends on Common. When
you OK the dialog it will prompt to rebuild and then AppA can access the
code in Common - no JAR file necessary. Don't forget to remove from AppA
the linked JAR file that you originally created from Common.

Hope this helps,
Eric
Previous Topic:Getting the row and column position of the mouse cursor
Next Topic:Linking editor sessions to a project
Goto Forum:
  


Current Time: Sun May 11 07:27:24 EDT 2025

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

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

Back to the top