Skip to content

Instantly share code, notes, and snippets.

@fogartyp
Last active December 10, 2015 16:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fogartyp/581e2ebc35a0c77b2cb1 to your computer and use it in GitHub Desktop.
Save fogartyp/581e2ebc35a0c77b2cb1 to your computer and use it in GitHub Desktop.
Creating a custom Java Runner on C9 IDE
// Create a custom Cloud9 build system - similar to the Sublime build system
// For more information see https://docs.c9.io/custom_runners.html
{
"cmd": [
"bash",
"-c",
"mkdir -p $(echo $file | sed -r \"s_/src/.*_/_g\")bin; find $(echo $file | sed -r \"s_/src/.*_/_g\")src -name '*.java' -print | xargs javac -sourcepath $(echo $file | sed -r \"s_/src/.*_/_g\")src -d \"$(echo $file | sed -r \"s_/src/.*_/_g\")bin\""
],
"info": "\\033[01;34mBuilding\\033[00m \\033[01;31m$project_name\\033[00m",
"selector": "source.java",
"working_dir": "$file_path"
}
// Create a custom Cloud9 runner - similar to the Sublime build system
// For more information see https://docs.c9.io/custom_runners.html
{
"cmd": [
"bash",
"-c",
"java -cp $(echo $file | sed -r \"s_/src/.*_/bin_g\") $(echo $file | sed -r \"s_.*/src/__g\" | sed -r \"s_\\.java__g\" | sed -r \"s_/_._g\")"
],
"info": "\\033[01;34mRunning\\033[00m \\033[01;31m$file_name\\033[00m\n",
"selector": "source.java",
"working_dir": "$file_path"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment