0

I was trying to change javac file text but it was not changing so I tried to delete and replace it with the below text copy when I tried deleting javac in Sublime java package it pops up notification "access denied". How can I replace it?

{
"cmd": ["javac", "$file_name","&&","java", "$file_base_name"],
"file_regex": "^(...?):([0-9]):?([0-9]*)",
"selector": "source.java",
"shell": true
}
MattDMo
  • 100,794
  • 21
  • 241
  • 231

1 Answers1

1

When you want to adjust an existing package, you shouldn't try to overwrite the original files. Think about it, once the package updates to a newer version, your changes will be gone.

Instead, Sublime Text offers different ways to customize packages – as mentioned in the Package Control documentation:

If a package for Sublime Text 3 is installed as a packed package, it should be possible to directly override individual non-python files. To do this, create a Packages/{Package Name}/ folder and save customized versions of the files with the same name they are in the .sublime-package file.

As mentioned by MattDMo, you can also create by additional build systems by saving the to Packages/User. You will then be able to select them from the build menu.

On a side note, make sure that your .sublime-build file is valid JSON – the enter code here part in your example makes it invalid!

idleberg
  • 12,634
  • 7
  • 43
  • 70
  • 1
    Just as a note, it's not Package Control that provides this functionality; the Sublime core loads packages like this natively (so, it will still work even in the absence of PC, though it seems unlikely that anyone would be in such a situation). – OdatNurd Dec 17 '20 at 17:20
  • You might also want to mention that you can save new build systems, etc. in the `Packages/User` folder. They won't override the same file in a `.sublime-package` file, but they'll still show up in the Build menu. – MattDMo Dec 17 '20 at 17:59