Type:
-cp . tells the java process to look in the current directory for the .class file named MyFirstApp.
ok do I type that at the begining of my code or in the terminal when I try to run it?
That would be a terminal command. At the terminal, the first string tells the system what program to run. The following strings are parameters given to the program. You should be able to do something similar with your code. For example, if your code is:
Code:
public class Test {
public static void main(String[] args) {
if(args.length >= 2)
System.out.println(args[0] + ", " + args[1]);
}
}
Then you can do the following behavior at the terminal:
> javac Test.java
> java Test Hi mom
Hi, mom
So what this shows is that programs like javac and java are run (actually "forked" or spawned off as another process) by the terminal and the following strings are passed to the program in turn. So the string set {"Test", "Hi", "mom"} is passed to the program java. java then runs the Test program and passes the string set {"Hi", "mom"} as parameters to that program. And then in our program, we simply printed them back out to the command prompt =/.
Hope this helps clear stuff up =). Even though that wasn't your original question...