我想在com.sun.jndi.ldap.LdapCtx中放置一个断点,看看它是如何工作的,但是,我的程序运行的是Java 11,并且这个类对Eclipse是不可见的.如何配置项目,以便可以使用"Open Type"对话框打开这个类?有必要将项目转换为模块化吗?

我在项目属性中try 了"Java Build Path"->"模块依赖项"->Java命名->"已配置的详细信息"->"Exposed Package...":

  • 套餐:com.sun.jndi.ldap
  • 目标模块:全部-未命名

我try 了"exports"和"opens",但它并不能让我真正查看里面的类.

默认工作区JRE:采用OpenJDK/jdk-11.0.3.7-HotSpot

.classpath:.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>

推荐答案

preference Java > Appearance > Type Filters中,为了能够例如通过Open Type(Ctrl+Shift+T).打开com.sun.jndi.ldap.LdapCtx,必须对过滤器100进行uncheck

Java相关问答推荐

ittext pdf延迟签名,签名无效

多个Java线程和TreeMap.put()的非预期行为

Junit with Mockito for java

Java中是否有某种类型的池可以避免重复最近的算术运算?

只需最少的代码更改即可将版本号标记添加到日志(log)

JavaFX如何在MeshView中修复多个立方体?

由于我在Main方法中关闭了 scanner ,但在该方法中创建了一个新的 scanner ,因此出现了错误

Jakarta CDI强制bean构造/注册遗留事件侦听器

Mac上的全屏截图在使用JavaFX时不能正常工作吗?

测试何时使用Mockito强制转换对象会导致ClassCastException

把一条整型短裤和两条短裤装成一条长的

自定义批注的外推属性值

为什么Spring Boot项目无法为基于MySQL的CRUD应用程序找到从JPARepository接口扩展的ProductRepository?

扩展视图高度,并将其拖动到较低的视图上,而不是将其向下推?

Cordova Android Gradle内部版本组件不兼容

A.ForEach与For(类型a:集合)

在Oracle db中,当我们提供字符串而不是数字时,比较是如何工作的?

基于Java中mm/dd/yy格式的最近日期对数组列表进行排序

我无法在我的Spring Boot应用程序中导入CSV依赖项

由于可为null,无法在kotlin中实现java接口