Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Make F3 open Java source from a different project
Make F3 open Java source from a different project [message #175463] Thu, 19 October 2006 12:58 Go to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
Platform: Intel Pentium M,
Ubuntu Dapper Drake,
eclipse 3.2

If I have a Java source file in the Java Editor, and then position the
cursor to see the definition of a class that resides in a different
Java project in the same workspace, is it possible to configure
Eclipse to display the source file, instead of the class file?

It's possible to use the JAD plugin to display a decompiled version of
the class file, but I'd rather have the original Java file.

I've also found a way of making the debugger pick up the Java souce
file from other projects, by adding the projects to the "Source Lookup
Path" of the "Source" tab of the run configurations.

But I haven't (yet) found an equivalent setting for the Java editor.
Does anyone know if there is one?

Thanx!


- Steinar
Re: Make F3 open Java source from a different project [message #175596 is a reply to message #175463] Thu, 19 October 2006 16:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse4.rizzoweb.com

Steinar Bang wrote:
> Platform: Intel Pentium M,
> Ubuntu Dapper Drake,
> eclipse 3.2
>
> If I have a Java source file in the Java Editor, and then position the
> cursor to see the definition of a class that resides in a different
> Java project in the same workspace, is it possible to configure
> Eclipse to display the source file, instead of the class file?

It sounds like your one project includes a JAR of the code from the
other project (that is why F3 is showing you the .class file). What you
want to do is make the one project depend on the other project directly,
not on a JAR. In the Project Properties, Build Path section you can edit
the Projects tab to include the other project. Also make sure to remove
the JAR from the Libraries tab.

Hope this helps,
Eric
Re: Make F3 open Java source from a different project [message #175658 is a reply to message #175596] Thu, 19 October 2006 21:27 Go to previous message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Eric Rizzo <eclipse4@rizzoweb.com>:

> It sounds like your one project includes a JAR of the code from the
> other project (that is why F3 is showing you the .class file). What
> you want to do is make the one project depend on the other project
> directly, not on a JAR. In the Project Properties, Build Path
> section you can edit the Projects tab to include the other
> project. Also make sure to remove the JAR from the Libraries tab.

Both projects are actually OSGi plugin projects, and both projects
results in more than one plugin. They're built using maven, and the
classpath of both projects is maintained by m2eclipse, based on the
POM for the project(s).

But I guess it would be possible to have maven make source JARs, drop
them into the repository, and then, somehow make my project pick them
up...?
Previous Topic:How to exclude directory from Build
Next Topic:can't install subclipse for eclipse 3.2.1 in linux RH Enterprise 4
Goto Forum:
  


Current Time: Fri Apr 26 18:27:49 GMT 2024

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

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

Back to the top