Java Compiler Script on Mac

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shivambhatele
    New Member
    • May 2020
    • 9

    Java Compiler Script on Mac

    I am trying to create a script that will automatically change the working directory to my Java code and then compile the code. I am able to change the directly to my path but I cannot figure out how to call the java compiler on the "filename" while taking the "filename" as an argument directly from the Terminal and i run this java code on the interviewbit online java compiler.

    Code:
     #!/bin/bash
        FILE = “$1”
        open -a Terminal /Users/Jarvis/Desktop/Codes/Java/CS\ 49J/
        javac “$FILE”
Working...