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

mgs27

macrumors newbie
Original poster
Sep 13, 2013
1
0
Hi, I'm completely new to java and was trying to run the "Hello, World" thing.
This is what I typed into the terminal window:

username$ ~/introcs/hello> javac HelloWorld.java

and this is what I got:
-bash: /Users/username/introcs/hello: is a directory

Can anyone tell me what I'm doing wrong??
Thanks!
 

mfram

Contributor
Jan 23, 2010
1,311
353
San Diego, CA USA
Post the code. What's the class called? It better be called HelloWorld or there will be problems. It's my experience when using javac command-line that the class name better match up with the file name. But maybe that's not your issue.
 

dylanryan

macrumors member
Aug 21, 2011
57
2
This has nothing to do with the code. The problem is, you are trying to paste the prompt that your teacher included to show you as part of the command.

Just try this:

javac HelloWorld.java
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.