Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Wildcat

macrumors regular
Original poster
Apr 23, 2002
139
0
Eugene, OR
Is there a way to compile and run single .java files from the terminal? I have heard this is possible. Or if that is not possible does anyone know another way to compile and run java in OS 10.1.
Thanks
 
Re: Java Help

Originally posted by Wildcat
Is there a way to compile and run single .java files from the terminal? I have heard this is possible. Or if that is not possible does anyone know another way to compile and run java in OS 10.1.
Thanks

Here is the way to do this:

1. Navigate to the directory where your .java file is located
2. Type "javac <filename>"
3. To run the program, type "java <filename without extension (.java)>"
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.