I have the following set up:
I have 4 packages:
- root/src/terminal – has some java files
- root/src/mail – has some java files
- root/src/data – has some java files
- root/src/main – has a single java file, Main.java
I also have the following files
- root/bin – a folder to store .class files
- root/mail.jar – a jar file which has important classes used in my code
Within the root, I would like to enter a terminal command which compiles root/src/main/Main.java and puts the class files in the root/bin location.
Can someone show me the command to do this? I’m on a Mac (running Leopard).
Here’s the one liner:
Alternatively, you could use absolute directory names:
In reference to Ant you said “I would rather keep it simple.”.
In fact in the long term it is simpler to create a simple Ant
build.xmlfile. The alternative is a bunch of non-portable scripts or batch file … or lots of typing.To run the application, assuming that you are still in the
/xyz/rootdirectory:Or on Windows:
Or modify the above to use absolute pathnames in the classpath argument; e.g.