Domanda

I am new to Sublime text 2 and don't know how to set up the build files. I've been trying to run the GridWorld case study, but I don't know how to setup the classpath to the GridWorld.jar file. This is the build I currently have:

    {
     "cmd": ["javac", "$file_name","&&","java", "$file_base_name"],
     "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
     "path": "C:\\Program Files\\Java\\jdk1.7.0_17\\bin\\",
     "selector": "source.java",
     "shell": true
    }

I've tried creating a CLASSPATH variable in my system environment variables, but when I try to run my BugRunner code I get an Error: Could not find or load main class BugRunner. If there is any other info you need I'll add more.

È stato utile?

Soluzione

you need to add -cp . to java command

{
 "cmd": ["javac", "$file_name","-cp",".","&&","java", "$file_base_name","-cp","."],
 "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
 "path": "C:\\Program Files\\Java\\jdk1.7.0_17\\bin\\",
 "selector": "source.java",
 "shell": true
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top