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”