javaeclipseldapeclipse-jdtmodule-path

debug unexported java packages of JDK modules in Eclipse


I want to place a breakpoint in com.sun.jndi.ldap.LdapCtx to see how it works, however, my program is running with Java 11 and this class is invisible to Eclipse. How to configure the project so this class can be opened with the "Open Type" dialog? Is it necessary to convert the project into modular?

I've tried in project properties "Java Build Path" -> "Module Dependencies" -> java.naming -> "Configured details" -> "Expose Package...":

I tried both "exports" and "opens", but it doesn't let me actually view the classes inside.

Workspace default JRE: AdoptOpenJDK/jdk-11.0.3.7-hotspot

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="javasource" />
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
    <classpathentry kind="lib"
        path="C:/Program Files/Mendix/9.5.1.27523/runtime/bundles/com.mendix.json.jar" />
    <classpathentry kind="lib"
        path="C:/Program Files/Mendix/9.5.1.27523/runtime/bundles/com.mendix.logging-api.jar" />
    <classpathentry kind="lib"
        path="C:/Program Files/Mendix/9.5.1.27523/runtime/bundles/com.mendix.m2ee-api.jar" />
    <classpathentry kind="lib"
        path="C:/Program Files/Mendix/9.5.1.27523/runtime/bundles/com.mendix.public-api.jar" />
    <classpathentry kind="lib"
        path="C:/Program Files/Mendix/9.5.1.27523/runtime/bundles/javax.servlet-api.servlet.jar" />
    <classpathentry kind="lib"
        path="C:/Program Files/Mendix/9.5.1.27523/runtime/bundles/javax.websocket-api.websocket.jar" />

    <classpathentry kind="output" path="deployment/run/bin" />
</classpath>

.project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>ActiveDirectorySearch_main</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
            <triggers>full,incremental,</triggers>
            <arguments>
                <dictionary>
                    <key>LaunchConfigHandle</key>
                    <value>&lt;project&gt;/deployment/run/componentbuild.launch</value>
                </dictionary>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>

ActiveDirectorySearch_main.launch

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/ActiveDirectorySearch_main"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="M2EE_ADMIN_PASS" value="1"/>
<mapEntry key="M2EE_ADMIN_PORT" value="8090"/>
<mapEntry key="M2EE_CONSOLE_PATH" value="C:/Program Files/Mendix/9.5.1.27523/modeler/MendixConsoleLog.exe"/>
<mapEntry key="MX_INSTALL_PATH" value="C:/Program Files/Mendix/9.5.1.27523"/>
<mapEntry key="MXCONSOLE_BASE_PATH" value="C:/Users/basin/Documents/Mendix/ActiveDirectorySearch-main/deployment"/>
<mapEntry key="MXCONSOLE_RUNTIME_PATH" value="C:/Program Files/Mendix/9.5.1.27523/runtime"/>
<mapEntry key="MXCONSOLE_RUNTIME_PORT" value="8080"/>
<mapEntry key="MXCONSOLE_RUNTIME_LISTEN_ADDRESSES" value="*"/>
<mapEntry key="MXCONSOLE_SERVER_URL" value="http://127.0.0.1:8090/"/>
</mapAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;ActiveDirectorySearch_main&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;ActiveDirectorySearch_main&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/Program Files/Mendix/9.5.1.27523/runtime/launcher/runtimelauncher.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.mendix.container.boot.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ActiveDirectorySearch_main"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.net.preferIPv4Stack=true -DMX_LOG_LEVEL=INFO -Djava.library.path=&quot;C:/Program Files/Mendix/9.5.1.27523/runtime/lib/x64;C:/Users/basin/Documents/Mendix/ActiveDirectorySearch-main/deployment/model/lib/userlib&quot; -Dfile.encoding=UTF-8 -Djava.io.tmpdir=&quot;C:/Users/basin/Documents/Mendix/ActiveDirectorySearch-main/deployment/data/tmp&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;C:/Users/basin/Documents/Mendix/ActiveDirectorySearch-main/deployment&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="C:/Users/basin/Documents/Mendix/ActiveDirectorySearch-main/deployment"/>
</launchConfiguration>

Solution

  • In the preference Java > Appearance > Type Filters you have to uncheck the filter com.sun.* in order to be able to open com.sun.jndi.ldap.LdapCtx e.g. via Open Type (Ctrl+Shift+T).