Runner behavior changed



I’ve had a custom Java build-and-run script in my workspace for the past ~6 months that has been working just fine. Today, at roughly ~7pm PST, the behavior changed drastically and it was hopelessly broken.

I can’t find any release notes for Cloud9, or anything else that indicated a change. Was this change intentional, or is this a bug?


    "cmd": ["java", "-classpath", "$OUT_DIR", "$MAIN_CLASS", "$args"],
    "env": {
        "OUT_DIR": "$([ -f .bin ] && rm -r .bin; mkdir -p .bin ; echo .bin)",
        "FILES": "$(find . -path './.c9*' -prune -o -print | grep '.*\\.java' | sed 's:^./::g' | tr '\n' ' ')",
        "MAIN_CLASS": "$(echo $file | sed 's:$project_path::g' | sed '$::g' | sed 's:/:.:g')",
        "COMPILED_FILES": "$(javac -d $OUT_DIR $FILES)"
    "info": "\\033[01;34mRunning\\033[00m \\033[01;31m$file_name\\033[00m\n",
    "selector": "",
    "working_dir": "$project_path"

Running a “” program before:

Hello, world!

Running a “” program after:

Error: Could not find or load main class $(echo | sed 's:.home.ubuntu.workspace.::g' | sed '$::g' | sed 's:.:.:g')


there was a bug in handling env variables which allowed to execute arbitrary code instead of using them literally.

Please update the runner to use script instead of env

    "script": [
        "OUT_DIR=\"$([ -f .bin ] && rm -r .bin; mkdir -p .bin ; echo .bin)\"",
        "FILES=\"$(find . -path './.c9*' -prune -o -print | grep '.*\\.java' | sed 's:^./::g' | tr '\n' ' ')\"",
        "MAIN_CLASS=\"$(echo $file | sed \"s:$project_path::g\" | sed '$::g' | sed 's:/:.:g')\"",
        "COMPILED_FILES=\"$(javac -d $OUT_DIR $FILES)\"",
        "java -classpath \"$OUT_DIR\" \"$MAIN_CLASS\" \"$args\""
    "env": {},
    "info": "\\033[01;34mRunning\\033[00m \\033[01;31m$file_name\\033[00m\n",
    "selector": "",
    "working_dir": "$project_path"


Awesome – that’s exactly the API I was looking for in the first place!

Thanks for the prompt and super-helpful reply.

closed #4