Advertisement
Chikkuri

JavaMacro2.bat

Mar 30th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.30 KB | None | 0 0
  1. @echo off
  2. echo (!) Batch running...
  3. echo ( )
  4. echo (!) reddit: /u/Chikkuri
  5. echo (!) This tool assists in compiling java files, only if you have jdk1.8.0_121 .
  6. echo ( )
  7. echo (!) Echo will now turn on.
  8. pause
  9. @echo on
  10.  
  11. set path=C:\Program Files\Java\jdk1.8.0_121\bin
  12. cd Desktop
  13.  
  14. @echo off
  15. echo ( )
  16. echo (!) Echo is now off.
  17. echo ( )
  18. echo (!) The default directory is Desktop. This can be edited via right-click - edit.
  19.  
  20.  
  21.  
  22.  
  23. :new
  24.     echo ( )
  25.     set /p UserInputPath2= "(?) Enter java file without .java extension: "
  26. goto again
  27.  
  28.  
  29.  
  30. :again
  31.     echo ( )
  32.     set /p UserInputPath= "(?) %UserInputPath2%.java - (S)elect_File, (C)ompile, (R)un, (Q)uit: "
  33.     if /i "%UserInputPath:~,1%" EQU "S" goto new
  34.     if /i "%UserInputPath:~,1%" EQU "C" goto compile
  35.     if /i "%UserInputPath:~,1%" EQU "R" goto run
  36.     if /i "%UserInputPath:~,1%" EQU "Q" goto stop
  37.     echo (!) Invalid input.
  38. goto again
  39.  
  40.  
  41.  
  42. :compile
  43.     echo (!) javac %UserInputPath2%.java
  44.     echo _________ (C) start of javac _________
  45.     javac "%UserInputPath2%.java"
  46.     echo _________ (C) end of javac _________
  47.     echo (!) Done.
  48. goto again
  49.  
  50.  
  51. :run
  52.     echo (!) java %UserInputPath2%
  53.     echo _________ (R) start of java _________
  54.     java "%UserInputPath2%"
  55.     echo _________ (R) end of java _________
  56.     echo (!) Done.
  57. goto again
  58.  
  59.  
  60. :stop
  61.     echo (!) Batch stopped.
  62. @echo on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement