A shell command which creates a new .java file with pre-defined template
-
Navigate to /usr/local/bin directory
cd /usr/local/bin -
Copy the files 'template.java' and 'newjava.sh' to this directory { You may need root permissions to copy }
-
Make the 'newjava.sh' file executable
chmod +x newjava.sh -
If bin folder in not created in ~/ directory,
4.1. Navigate to ~/
cd ~/
4.2. Create a folder named bin
mkdir bin
4.3. Edit the ./bash_profile file
cd bin
vim ./bash_profile
Press 'i' to start editing
Add 'export PATH=~/bin:$PATH' to the file
Press ESC and :wq to save the file and quit
-
Open the terminal
Ctrl + Alt + T -
Type 'newjava.sh filename' and press ENTER