├── .github └── workflows │ ├── Test-Python.yml │ └── codeql-analysis.yml ├── .gitignore ├── Executor_Java.bat ├── LICENSE ├── README.md ├── Support.md ├── assets ├── Screenshots │ ├── 001 File Structure.PNG │ ├── 002 Execution.PNG │ └── 003 Execution.PNG └── shortcuts.xml ├── filename_class.py ├── filename_java.py └── plugin.py /.github/workflows/Test-Python.yml: -------------------------------------------------------------------------------- 1 | name: PythonTest 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: windows-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions/setup-python@v2 12 | with: 13 | python-version: '3.9.9' 14 | architecture: 'x64' 15 | - name: build 16 | run: | 17 | python --version 18 | python -m pip install --upgrade pip 19 | pip install wheel 20 | pip install pylint 21 | pylint filename_class.py 22 | pylint filename_java.py 23 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '17 21 * * 5' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-20.04 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [ 'python' ] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v2 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v1 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v1 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | #- run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v1 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Input.txt 2 | *.SED -------------------------------------------------------------------------------- /Executor_Java.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM GitHub Link:https://github.com/garvit-joshi/Java_Executor-Windows 3 | ECHO WELCOME TO JAVA EXECUTOR 4 | ECHO -Garvit Joshi(garvitjoshi9@gmail.com) 5 | ECHO USER:%USERNAME% 6 | ECHO v: 1.2012.9+ 7 | echo. 8 | ECHO JAVA version installed: 9 | ECHO ------------------------------------------------------------------------- 10 | java -version 11 | ECHO ------------------------------------------------------------------------- 12 | cd /d "%~dp0" 13 | :first 14 | SET /A ErrorCode = 0 15 | ECHO LOOKING FOR FILES IN:"%~dp0" 16 | echo. 17 | ECHO Name Of Java Executable Files Present In Folder Are: 18 | python filename_java.py 19 | set /p inp1= 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java_Executor (Windows) 2 | A Simple Java Executor For Making .java Files Compiled And Interpret .class Files.
3 | When I Was New To Java I Had Difficulty in opening Command Prompt, Going To Directory And Then Compiling My Newly Made Files. So, I created this Batch File Program. It simply goes to the directory where the program is being Executed And Gives A List Of .java files that you could compile.
4 | The program works with two Python Files ( Filename_class.py and Filename_java.py ) that I Have included in this Repository.
5 | The project is also available for [Linux User](https://github.com/garvit-joshi/Java_Executor-Linux)
6 | 7 | ## Pre requisite 8 | 1. [Java JDK](https://www.oracle.com/java/technologies/javase-downloads.html).
9 | 2. [Python](https://www.python.org/downloads/).
10 | 3. Python And Java Should Be Installed With Environment Variables.
11 | 12 | ## Steps: 13 | 14 | 1. Install [Python](https://www.python.org/downloads/), when installing Python check the box with ```Add Python To PATH```. 15 | 16 | 2. Install Java 17 | 18 | 3. Now just Make A Folder In your desired directory where you will keep all your java files And Put These Three Files In The Directory 19 | 20 | 4. The Files Are Designed In such a way that they Search For All the .java And .class files and runs them. 21 | 22 | ### For Notepad++ Support 23 | [Read Support.md](Support.md) 24 | -------------------------------------------------------------------------------- /Support.md: -------------------------------------------------------------------------------- 1 | # Support To Notepad++ 2 | 1. After Installing Notepad++, close all instances of Notepad++, and run [plugin.py](./plugin.py). 3 | 4 | 2. Place [Executor_Java.bat](./Executor_Java.bat), [filename_class.py](./filename_class.py), and [filename_java.py](./filename_java.py) in the same folder where Java Files are kept. 5 | 6 | 3. Open any java file in Notepad++, and press ```F6```. 7 | 8 | 4. Enjoy. 9 | -------------------------------------------------------------------------------- /assets/Screenshots/001 File Structure.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garvit-joshi/Java_Executor-Windows/452205c1adb6930eca3b12ae4c4c44f947c68333/assets/Screenshots/001 File Structure.PNG -------------------------------------------------------------------------------- /assets/Screenshots/002 Execution.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garvit-joshi/Java_Executor-Windows/452205c1adb6930eca3b12ae4c4c44f947c68333/assets/Screenshots/002 Execution.PNG -------------------------------------------------------------------------------- /assets/Screenshots/003 Execution.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garvit-joshi/Java_Executor-Windows/452205c1adb6930eca3b12ae4c4c44f947c68333/assets/Screenshots/003 Execution.PNG -------------------------------------------------------------------------------- /assets/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | https://www.php.net/$(CURRENT_WORD) 11 | https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD) 12 | cmd /k cd $(CURRENT_DIRECTORY) && "$(CURRENT_DIRECTORY)/Executor_Java.bat" 13 | $(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /filename_class.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Java Executor-Executes Java files with simplicity 3 | Copyright (C) 2021 Garvit Joshi 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | ''' 19 | #GitHub Link:https://github.com/garvit-joshi/Java_Executor-Windows 20 | import glob 21 | COUNT=0 22 | ifile=open("Input.txt","w") 23 | SERIAL_NO=1 24 | WORD_LENGTH=10 25 | for file in glob.glob("*.class"): 26 | if COUNT%2==0: 27 | print(SERIAL_NO,".",file,end="") 28 | SERIAL_LENGTH=str(SERIAL_NO) 29 | WORD_LENGTH=len(file)+len(SERIAL_LENGTH) 30 | else: 31 | print("".rjust(40-WORD_LENGTH,' '),SERIAL_NO,".",file) 32 | SERIAL_NO = SERIAL_NO + 1 33 | COUNT=COUNT+1 34 | print("") 35 | FLAG=1 36 | FILE_NAME=-1 37 | FILE_NO=0 38 | while FLAG in (1,2): 39 | FLAG=1 40 | try: 41 | FILE_NO=int(input("Enter The File No. You Want To Execute:")) 42 | except ValueError: 43 | print("Oops! \nThat was no valid number. \nTry again...") 44 | FLAG=2 45 | SERIAL_NO=1 46 | if FLAG!=2: 47 | for file in glob.glob("*.class"): 48 | if SERIAL_NO==FILE_NO: 49 | FLAG=0 50 | FILE_NAME=file 51 | break 52 | SERIAL_NO = SERIAL_NO + 1 53 | FLAG=1 54 | if FLAG==1: 55 | print("File Not Found!!\nPlease Try Again...") 56 | FILE_NAME= FILE_NAME[:-6] 57 | ifile.write(FILE_NAME) 58 | ifile.write("\n") 59 | ifile.close() 60 | -------------------------------------------------------------------------------- /filename_java.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Java Executor-Executes Java files with simplicity 3 | Copyright (C) 2021 Garvit Joshi 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | ''' 19 | #GitHub Link: https://github.com/garvit-joshi/Java_Executor-Windows 20 | import glob 21 | COUNT=0 22 | ifile=open("Input.txt","w") 23 | SERIAL_NO=1 24 | WORD_LENGTH=10 25 | for file in glob.glob("*.java"): 26 | if COUNT%2==0: 27 | print(SERIAL_NO,".",file,end="") 28 | SERIAL_LENGTH=str(SERIAL_NO) 29 | WORD_LENGTH=len(file)+len(SERIAL_LENGTH) 30 | else: 31 | print("".rjust(40-WORD_LENGTH,' '),SERIAL_NO,".",file) 32 | SERIAL_NO = SERIAL_NO + 1 33 | COUNT = COUNT + 1 34 | print("") 35 | FLAG=1 36 | FILE_NAME=-1 37 | while FLAG in (1,2): 38 | FLAG=1 39 | try: 40 | FILE_NAME=int(input("Enter The File No. You Want To Execute:")) 41 | except ValueError: 42 | print("Oops! \nThat was no valid number. \nTry again...") 43 | FLAG=2 44 | SERIAL_NO=1 45 | if FLAG!=2: 46 | for file in glob.glob("*.java"): 47 | if SERIAL_NO==FILE_NAME: 48 | FLAG=0 49 | FILE_NAME=file 50 | break 51 | SERIAL_NO = SERIAL_NO + 1 52 | FLAG=1 53 | if FLAG==1: 54 | print("File Not Found!!\nPlease Try Again...") 55 | ifile.write(FILE_NAME) 56 | ifile.write("\n") 57 | ifile.close() 58 | -------------------------------------------------------------------------------- /plugin.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Java Executor-Executes Java files with simplicity 3 | Copyright (C) 2021 Garvit Joshi 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | ''' 19 | import os 20 | import shutil 21 | UserName = os.getlogin() 22 | path = os.path.join('C:\\','Users',UserName,'AppData','Roaming','Notepad++','shortcuts.xml') 23 | try: 24 | os.remove(path) 25 | shutil.copyfile(r'./assets/shortcuts.xml',path) 26 | print(">>> Plugin Installed <<<") 27 | except FileNotFoundError as fnf: 28 | print(f"Please Check if Notepad++ is Installed: \n{fnf}") 29 | --------------------------------------------------------------------------------