.class file opens instead of .java while debugging

前端 未结 9 608
北恋
北恋 2020-12-29 03:14

Current setup:

  • MainProject which is a Library Project

  • BranchProject which is a new projects and has MainPr

相关标签:
9条回答
  • 2020-12-29 04:01

    Most of the time it happens when specific source folder are not added in build path Sources tab.

    Right-click on the Project in the Package-Explorer, click Build Path -> Configure Build Path -> Source Tab

    Add the source folder if your project source folder is not there. Select Add folder -> select your project source folder specifically. Eg: project_name/src . Then Apply it and restart server.

    0 讨论(0)
  • 2020-12-29 04:06

    The problem is that the class file is preferred over the java (by default), here is how you can change that for Eclipse (tested on NEON 2):

    1. Right-click on the Project in the Project-Explorer, click Properties
    2. On the new window select: Run/Debug Settings
    3. Create a new configuration (or duplicate another one)
    4. Select the new config and click Edit...
    5. Go to the tab Source
    6. Select the Default and Remove
    7. Create a new path with Add..., select Java Library, then JRE System Library
    8. Create a new path with Add..., select the location where the sourcecode is by Workspace folder (if it is a project in the same workspace) or File System directory (it it is not)
    0 讨论(0)
  • 2020-12-29 04:07

    Skyler's answer from this post worked for me: Opening source code from debug view edits .class after Android R18 update

    Here is a summary: The fix is to right click the Project name in the debug view, and select "Edit Source Lookup..." from the menu. From there, remove the Default lookup path. After that, manually add the associated projects (not jars) that your project references. This is done by clicking Add, selecting Java Project, then checking the appropriate projects.

    0 讨论(0)
提交回复
热议问题