You can use command line commands from withing Java using the
Runtime.exec() method, but you should try to avoid it at all costs. The
main reason to avoid it is because it makes your application much less
portable. You should try instead to use the functionality in the Java
API or extend it to provide this functionality.
For example, if you want to copy one file to another in Java you could
do something like:
FileInputStream in = new FileInputStream("filename1");
FileOutputStream out = new FileOutputStream("filename2");
int b = -1;
while((b = in.read()) != -1){
out.write(b);
}
out.close();
in.close();
You can do a lot to make this better though, such as buffering your
input and output data, checking to see if files exist before reading and
writing, catching exceptions, etc.