Can't save the file «/usr/share/netbeans/10.0/etc/netbeans.conf»? - netbeans

I am trying to change the jdk access path in the netbeans.conf file to solve the java.lang file not found problem and I cannot save this file with a new name or the same name, so I cannot solve the problem. It reports to me, You don't have permission for do that, how to solve?
I use linux mint 20 Ulyana.

Make sure Netbeans or a connected process is not running. Try completely powering down your system, then start it back up again.
If that does not work, then use the vi editor to edit the file and try putting "sudo" before the command like this:
sudo vi /usr/share/netbeans/10.0/etc/netbeans.conf
It may prompt you for your password.
Learning to use vi is an excellent skill.
Always be very careful using sudo. Usually there is a reason why normal users cannot access files and sudo can. So take a back up just in case.

Related

Can't install neovim in windows

I want to have neovim. I installed it with choco install neovim in the PowerShell (admin). Then I followed a lot of tutorials, like the one of theprimeagen, but I can't get pass the first steps. Maybe is because I don't have Linux, as everybody does, but I don't think is that.
I created a folder like so: C:/users/myusername/.config/nvim. Then, in this folder I type nvim . to open the Explorer of neovim and start creating the .lua files. The problem is that I always get a stupid .nvimlog every time I enter neovim, I think is the reason why I can't install plugins correctly or remap some keys.
In the .nvimlog every time I enter neovim appears a new line that says:
ERR 2023-02-12T12:55:04.800 nvim.15716.0 terminfo_start 374: uv_tty_set_mode failed: invalid argument. And I swear I followed every tutorial in the exact way, and even without creating any file the .nvimlog is always there.
In windows, the default config directory is ~/AppData/Local, based on their official documentation. I don't know if there is a way to change that, but that is how i configured it.
To find out where your config directory is you can also use :echo stdpath('config').

How to undo after running sudo code . --user-data-dir='.'?

I was doing the VSCode configuration, but accidentally I saw this command line which I am not sure what it is doing.
However, after running, it always creates the cache data whenever I start my VSCode.
Note: Whenever I typed this command in any directory, it'll automatically shown those folder and file in that directory.
By setting --user-data-dir you're telling VS Code where it should keep your user / session data, which is why it's creating all of those new directories. This is necessary because when you run code as sudo, it doesn't know where your user data directory is, since you're running as a different user. Like this answer says, you probably shouldn't be running code with sudo: VSCode - what exactly --user-data-dir is specifiying. See that answer for suggestions on alternatives.
As for deleting the data it made, just a simple sudo rm -rf <dir> should do the trick (be careful of course).

Neovim error: E492: Not an editor command: PlugInstall

OS: Ubuntu 18.04.3 LTS
I just installed neovim using sudo apt-get install neovim and added the folder and file ~/.config/nvim/vim.init. At this moment the file has no content, but when I open up nvim and type :PlugInstall I get error: E492: Not an editor command: PlugInstall. I am clueless, what is going wrong?
I think you are trying to use vim-plug without previously installing it.
I changed my plug#begin to
call plug#begin('~/.local/share/nvim/site/autoload/plug.vim')
and it worked for me now
I followed this and it worked: https://github.com/junegunn/vim-plug/wiki/tutorial
I also wrote call plug#begin('~/.config/nvim/plugged) and made a directory at that location. Then the reload command is also source ~/.config/nvim/init.vim where init.vim is the configuration file. And then I just ran :PlugInstall and it worked :D
I got this error too, but in my case I was typing :pluginstall instead of the case-sensitive :PlugInstall and you have to use the correct case or it won't work. Oddly, :PlugUpdate was able to work before :PlugInstall but that was just because I typed the case correctly.
I see I have the vim.plug correctly installed here
~/.vim/autoload/plug.vim
I also created a "plugged" folder here and I see this is where vim-plug put the downloaded files from running :PlugInstall
.vim/plugged
To be overly pedantic, I typed 'cd' to get to the user directory, then cd .vim to go into my dotted .vim folder, then "mkdir plugged" to create the plugged directory. Not sure if this was 100% necessary or if :PlugInstall would have created it by itself.
I also needed to :source ~/.vimrc between adding addition plug line items and typing :PlugInstall, so make sure you "source" or you can also completely quit and restart your Vim so it will reload your .vimrc file, otherwise it won't know anything about your file edits.
I'm on a Mac. I installed vim-plug for standard vim and this gave me this file
~/.vim/autoload/plug.vim
My .vimrc is this:
" add line numbers
set number
call plug#begin()
" The default plugin directory will be as follows:
" - Vim (Linux/macOS): '~/.vim/plugged'
" Make sure you use single quotes
Plug 'tomasiser/vim-code-dark'
Plug 'tpope/vim-sensible'
call plug#end()
I had the same problem and come here for leave my contribution ( I hadn't find this solution in anywhere ). In my case, it's caused by permissions in my linux. I always start my vim for ocults archives with:
sudo vim .vimrc
In this case, the Vim just use the default commands ( I don't know why but I think this is by the security ). If you just run:
vim .vimrc
All the user commands will be able.
In my case, I had multiple terminal windows open. I still had the Vim window open after installing vim-plug in another window. Solution was to close and re-open Vim.
Instead of
call plug#begin()
I did
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
Worked 100%
If you have followed the steps in https://github.com/junegunn/vim-plug, but still didn't work.
Try run ':source ~/.config/nvim/vim.init' in vim (not source ~/.config/nvim/vim.init in shell).
Make sure git is installed.
In my case, I was trying to do :PlugInstall in a docker container and did not have git installed. I installed git, and it worked.

Atom - Unable to save file: Permission denied (Windows)

I've been a long time user of notepad++ and I enjoy it a lot, but a friend recently recommended me to use Atom, so I gave it a try. However, when I try to save anything in my project folder (or any file at all), I receive this message that I am unable to save file: permission denied.
I've tried typing the command sudo atom /path/to/file in my PowerShell for Windows, but I get the following message:
I understand that sudo is a Linux-based command and thus would not work in a Windows environment but would there be an alternative route to get Atom working on my machine?
Thanks a lot!
The files were made "Read Only" somehow (maybe your anti-virus software or something, who knows...).
Solution:
Go to the folder in the Explorer, highlight all of the files in your project. Right click, open the properties. Deselect "Read-Only" and push ok. When it asks if you would like to apply to only the selected files or also to the files in any sub-folders, click yes if you need to.
This should fix your problem.

How to execute shell script by double clicking in centos?

As the tile,I have a shell script needs to run every time I have to open a terminal and type "./ xxx.sh" .it is annoying when it gets too frequent now how do I execute by double clicking like the way you do it in windows?
I know there is an option just for that in Ubuntu but I can't see that here in CentOS.
I did a little bit of digging up and found these two links. Let me know if they were helpful
https://askubuntu.com/questions/286621/how-do-i-run-executable-scripts-in-nautilus
https://unix.stackexchange.com/questions/189777/how-to-launch-shell-script-with-double-click-in-centos-7
The first link is an askUbuntu link I know. But gnome uses nautilus as the file explorer program.
In my arch linux installation where I am running a cinnamon desktop environment, I just had to add a shebang (#!/usr/bin/bash) at the head of the file and use chmod to make the file an executable and I could run the script from by double clicking on it. I hope you have already tried this?
For the record this is how I do it:
In terminal
[youname#localhost ~]$ gedit ~/Desktop/YourApplication.desktop
In the file
[Desktop Entry]
Name=My Application
Comment=My Application run script
Exec=/AddressOfyourScript/yourscript.sh
Icon=/AddressOfyourIcon/youricon.png
Terminal=true
Type=Application
save and done.Apparently CentOS should give a GUI for this function.