DonJayamanne / javaVSCode

Extension for java development on VSCode (deprecated)
https://marketplace.visualstudio.com/items?itemName=donjayamanne.javaDebugger
MIT License
43 stars 30 forks source link

Error: Could not find or load main class IncrementOper #41

Closed stalinstepin closed 7 years ago

stalinstepin commented 7 years ago

Hi @DonJayamanne,

Already refered to the following post: Error: Could not find or load main class TestingJava #28

Tried out everything but hitting the same issue again and again. Can somebody help me?


So here is my Java code:

package modules;

public class IncrementOper {

    public static void main(String[] args) {
            // TODO Auto-generated method stub

int x=9; do { System.out.println("The value of x:" +x); x=x-1; } while (x<=1); }

}


And here is my launch.json file:

{ "version": "0.2.0", "configurations": [

    {
        "name": "Java",
        "type": "java",
        "request": "launch",
        "stopOnEntry": true,
        "jdkPath": "/opt/java/jdk1.8.0_131/bin",
        "cwd": "${workspaceRoot}",
        "startupClass": "IncrementOper",
        "options": [
            "-classpath",
            "${workspaceRoot}:."
        ]
    },
    {
        "name": "Java Console App",
        "type": "java",
        "request": "launch",
        "stopOnEntry": true,
        "jdkPath": "/opt/java/jdk1.8.0_131/bin",
        "cwd": "${fileDirname}",
        "startupClass": "IncrementOper",
        "options": [
            "-classpath",
            "${workspaceRoot}:."
        ],
        "externalConsole": true
    }
]

}

stalinstepin commented 7 years ago

So here is my env details:

NAME="Ubuntu" VERSION="16.04.2 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.2 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial

java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

faustinoaq commented 7 years ago

@stalinstepin see #28