There is no source file attached to the class




















Looks like eclipse is out dated IDE. I am using the latest version of Eclipse version It is killing all my time.

My intension is run the application in debug mode navigate through the sub projects which are added as external dependencies non modifiable. First we have to determine which jar file's source code we want along with version number.

For Example "Spring Core" » "4. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Attach the Source in Eclipse of a jar Ask Question. Asked 8 years, 10 months ago. Active 28 days ago.

Viewed k times. I added a Student. You can attach the source by clicking Attach Source below Now I am not sure how should I attach the source in my eclipse. Improve this question. Kata Please explain how the link you give will answer the question. Click OK. Should I unzip the Student. Or something else. As I tried the above option, and I am still seeing the same behavior.

Nevzz03 I am sorry, I pasted the wrong link. Here is the right one: help. Kata, see my previous comment. Nevzz03 You need to point to the location of the source files, not the compiled class files.

If your JAR file contains. Unless you explicitly added these yourself, I doubt this is the case, so unzipping the JAR file won't be helpful anyway. Show 3 more comments. Active Oldest Votes. It does what eclipse should do - a right click context menu that says "Attach Java Source. Improve this answer. I found a major issue with this plugin. I have a maven dependency jar file downloaded and while trying to get source for this jar ; got an error "Sorry but source code cannot be found in our database".

Even after providing github repo URL ; it never downloaded the source files — vikramvi. I have a maven project in eclipse STS. I don't see the attach source option there. Just for info, It fails to attach java10 source, anyways we can attach it manually.

Add a comment. You need to import the project from jar and add the Project as dependency. Avinash Singh Avinash Singh 2, 1 1 gold badge 16 16 silver badges 21 21 bronze badges. Thanks Avinash, I tried your second option but still it says the same thing. What I did is- After unzipping the jar I will be getting a folder right?

So if I point to that folder, I should be able to see the source code properly right? But it is not happening to me. I am not able to see the class file properly. What do you mean you can't see class file properly? Class files won't be in a readable format as they will contain bytecode. If you don't have the source files. Nevzz03 Does the JAR file contain any. Most likely it only contains. Eclipse is asking you to tell it where the. That said, you don't necessarily need the source to debug.

Thanks for the suggestion. After unzipping the jar I will be getting a folder right? Nevzz03 Do you have the. If not, then no, you cannot attach the source files to Eclipse because you don't have them. Note that when you "create the java files" using a decompiler or using a plugin that does this for you, ie. Hence when debugging, the debugger might not be able to synchronize properly ie.

Hence it's always better if you can get the real source code that includes comments — Adrien Be. I wish I had known about that addon sooner. Everlight Everlight 4 4 silver badges 18 18 bronze badges. Code-Apprentice 74k 19 19 gold badges silver badges bronze badges. I have put that. However, when I try to use it in code, I can't get the javadoc for it, nor I can see the actual code from the referenced classes. It says it has no source attachment.

What is it meant by source attachment? I do have a javadoc folder that came with it, but when I attach it to my build path, it still reports it could not found the javadoc for the classes. Any ideas on that? Some jars will come with java doc and code and others won't. Select Validate! First: Navigate to the jar itself in the Eclipse project explorer to the left and try to open aclass of the jar.

Then, you will see the warning that it has no source attachment , and a button to attach the source code. Then, push the button, select "external folder" and then navigate to the folder with source you already have. Jar files can be built with or without source code. It's normal for 3rd party applications to produce a binary jar and a source jar, but it isn't required. The message is telling you that it doesn't know where the source code is for the library you are using.

It's been a long time since I've done this in eclipse, but there is a way in the project settings to point each library jar to the corresponding source location which can be a jar, zip file or directory. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. No source attachment in Java Ask Question. Asked 6 years, 6 months ago. Active 6 years, 6 months ago.

Viewed 10k times. I want to be able to see the javadoc. Improve this question. Whizzil Whizzil 1, 6 6 gold badges 19 19 silver badges 33 33 bronze badges.



0コメント

  • 1000 / 1000