Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Attach Source not working(cannot attach the source of a jar file)
Attach Source not working [message #521151] Tue, 16 March 2010 15:11 Go to next message
John Missing name is currently offline John Missing nameFriend
Messages: 6
Registered: January 2010
Junior Member
I have a jar on my build path of a project, the source of the jar is another project in my workspace.

When I hit F3 to see the source of a class or method a "Class File Editor" window opens which tells me "Source not found". I click the "Attach Source..." button and a "Source Attachment Configuration" dialog opens.
There are 3 options to choose from, Workspace, External File, External Folder.
None of them work, I can choose an option, select the source, click ok, the cursor goes to an hour glass, when it returns to an arrow nothing has happened, no source.

I can compile the jar with the source, but this is more work then it sounds like.

Any ideas?

Some more info, I'm running Oracle Workshop for WebLogic 10.3, which is running over Eclipse 3.3.2
Thanks
John

[Updated on: Tue, 16 March 2010 15:11]

Report message to a moderator

Re: Attach Source not working [message #521184 is a reply to message #521151] Tue, 16 March 2010 16:41 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

I have trouble with this too. When it's code you have, don't go find the
code itself, but select the src folder above it. At least, when it has
worked for me, that's what I've done.

Also, of course, if the (foreign) JAR you're consuming doesn't include
source code, you won't be able to see it.

Last, try right-clicking on the project, choose Build Path, then the
Libraries tab, click on the triangle next to the library whose code
interests you, then expand the JAR in question, click on Source, then
navigate, similarly, to the place where the source should be. This is, I
think, how you're supposed to set things up ahead of running into
missing code in the editor (ctrl-click) or debugger.

Again, when it has ever worked, this has been how I've done it. It
doesn't seem to work every time. I'm hoping one day to understand why.

Best of luck,

Russ Bateman

On 3/16/2010 9:11 AM, John wrote:
> I have a jar on my build path of a project, the source of the jar is
> another project in my workspace.
>
> When I hit F3 to see the source of a class or method a "Class File
> Editor" window opens which tells me "Source not found". I click the
> "Attach Source..." button and a "Source Attachment Configuration" dialog
> opens.
> There are 3 options to choose from, Workspace, External File, External
> Folder.
> None of them work, I can choose an option, select the source, click ok,
> the cursor goes to an hour glass, when it returns to an arrow nothing
> has happened, no source.
>
> I can compile the jar with the source, but this is more work then it
> sounds like.
>
> Any ideas?
>
> Some more info, I'm running Oracle Workshop for WebLogic 10.3, which is
> running over Eclipse 3.3.2
> Thanks
> John
Re: Attach Source not working [message #521211 is a reply to message #521184] Tue, 16 March 2010 18:12 Go to previous messageGo to next message
John Missing name is currently offline John Missing nameFriend
Messages: 6
Registered: January 2010
Junior Member
Thanks for the reply Russ, I'm afraid that doesn't work. This really only a problem when running the debugger, otherwise I can just browse to the class.
I guess whenever it become a problem I'll just recompile the jar with the source attached.

thanks anyway
john
Re: Attach Source not working [message #521402 is a reply to message #521211] Wed, 17 March 2010 09:16 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 3/16/10 2:12 PM, John wrote:
> Thanks for the reply Russ, I'm afraid that doesn't work. This really
> only a problem when running the debugger, otherwise I can just browse to
> the class.

In that case, you have to remember that the runtime classpath is
different from the build path. You may have the source attached
correctly but the launch configuration might refer to a different JAR
for those classes. Double-check that the build path and the launch
config are in sync.

Hope this helps,
Eric
Re: Attach Source not working [message #521466 is a reply to message #521402] Wed, 17 March 2010 16:40 Go to previous messageGo to next message
John Missing name is currently offline John Missing nameFriend
Messages: 6
Registered: January 2010
Junior Member
Thanks for the heads up Eric
Re: Attach Source not working [message #805472 is a reply to message #521466] Thu, 23 February 2012 20:17 Go to previous messageGo to next message
Melinda Savoy is currently offline Melinda SavoyFriend
Messages: 2
Registered: February 2012
Junior Member
Thank goodness someone else had posted about this. Did any of you guys ever find a solution to this issue? I just took a new job and no one here seems to understand that a java source attachment file can be applied to the JAR. Specifically, I am trying to apply the spring-sources.jar file to the SPRING.JAR file. I put the path in and then the path disappears if I go back in their to view it.

This is a major snafu on Oracle's part because as stated previously when I want to see what a particular method is doing I can't. I'm completely new to SPRING and really could use a fix for this.

Just an FYI, I posted this same question on the Oracle Workshop forum and of course no one ever responded.

Any HELP would be appreciated. Regards.

[Updated on: Thu, 23 February 2012 20:21]

Report message to a moderator

Re: Attach Source not working [message #806235 is a reply to message #805472] Fri, 24 February 2012 18:31 Go to previous messageGo to next message
John Missing name is currently offline John Missing nameFriend
Messages: 6
Registered: January 2010
Junior Member
I never got this to work, since they were all projects in development I just slowly slowly slowly added the source to each jar or war. Sorry
Re: Attach Source not working [message #1823751 is a reply to message #521151] Wed, 01 April 2020 10:13 Go to previous message
RAMAKRISHNA BAKALE is currently offline RAMAKRISHNA BAKALEFriend
Messages: 1
Registered: April 2020
Junior Member
Solved:
I had the same problem. Even though I had included the dependent projects into the build path, ecipse was always opening the class file from the jar file rather than the source file from the project. I had done all sorts cleaning, refreshing and everything. But didn't seem to work. Then I checked the versions of the jar and the corresponding project in the workspace. They were different. I corrected these. Then it started opening the source files.
Hope this helps some. :)
Previous Topic:EMF Problem & UML class diagram
Next Topic:Double( String ) not working
Goto Forum:
  


Current Time: Sat Apr 20 03:02:28 GMT 2024

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

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

Back to the top