I am attempting to create a bash alias that compiles all files with the .java extension and then runs all the files with the .class extension in the current working directory.
I currently have the alias
alias jcompile="cd $pwd; javac *.java; java *.class"
I would expect this to find any java programs and compile them, and then run them, but it throws this error.
error: file not found: *.java
Usage: javac <options> <source files>
use --help for a list of possible options
Error: Could not find or load main class *.class
Caused by: java.lang.ClassNotFoundException: *.class
$pwd?$PWDcd $(pwd)or bettercd "$PWD". But both are useless.