I am not very experience with java and this is driving me crazy. I wrote a java program FileManagement and I need to run it from the command line.
I can
(This is the KISS answer.)
Let's say you have several .java files in the current directory:
$ ls -1 *.java
javaFileName1.java
javaFileName2.java
Let's say each of them have a main() method (so they are programs, not libs), then to compile them do:
javac *.java -d .
This will generate as many subfolders as "packages" the .java files are associated to. In my case all java files where inside under the same package name packageName, so only one folder was generated with that name, so to execute each of them:
java -cp . packageName.javaFileName1
java -cp . packageName.javaFileName2