I have progm that with a class that has the main method, and that method takes arguments which must be typed in the command line...how do i compile and run the class from the terminal using mac cmds
what is the syntax? thnx

Recommended Answers

All 3 Replies

java PROGRAM_NAME argument_1 argument_2 [...]

Member Avatar for coil

The above command is to run your class; to compile it (do this first), javac PROGRAM_NAME.java

Sorry, yes, I neglected the compile part. Thanks, coil, for filling that in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.