如何在Visual Studio Code + java上调试Framework 1.x应用程序

问题描述 投票:0回答:1

我有问题要弄明白我怎么能这样做,正如标题所说。

我在这部分阅读了文档:

https://www.playframework.com/documentation/1.4.x/ide#custom

不成功。仍然没有调试。我可以通过控制台运行它并使用VSCODE编辑代码。

编辑1:在eclipse中我使用以下文件来运行/ debug:

<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
        <listEntry value="/cashup-starter" />
    </listAttribute>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
        <listEntry value="4" />
    </listAttribute>
    <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true" />
    <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
        <listEntry value="org.eclipse.debug.ui.launchGroup.run" />
    </listAttribute>
    <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
        <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#xA;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;cashup-starter&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#xA;" />
        <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#xA;&lt;runtimeClasspathEntry internalArchive=&quot;/cashup-starter/conf&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#xA;" />
        <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#xA;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#xA;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;cashup-starter&quot;/&gt;&#xA;&lt;/runtimeClasspathEntry&gt;&#xA;" />
    </listAttribute>
    <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false" />
    <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="play.server.Server" />
    <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cashup-starter" />
    <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=" -noverify -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dplay.debug=yes -Dplay.id= -Dapplication.path=&quot;${project_loc:cashup-starter}&quot; -Djava.endorsed.dirs=&quot;F:\dev\play-1.5.1/framework/endorsed&quot; -javaagent:&quot;F:\dev\play-1.5.1/framework/play-1.5.1.jar&quot;" />
</launchConfiguration>

在Visual Studio代码中,我有这个启动文件:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Debug (Launch) - Current File",
            "request": "launch",
            "mainClass": "${file}"
        },
        {
            "type": "java",
            "name": "Debug (Launch)-Tup<custom-extincentro>",
            "request": "launch",
            "mainClass": "jobs.Tup",
            "projectName": "custom-extincentro"
        }
    ]
}
java playframework visual-studio-code vscode-settings playframework-1.x
1个回答
1
投票

@ ikk1您是否尝试过以下launch.json配置?

        {
            "type": "java",
            "name": "Debug (Launch)",
            "request": "launch",
            "mainClass": "play.server.Server",
            "projectName": "cashup-starter"
        }

© www.soinside.com 2019 - 2024. All rights reserved.