Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Running Java apps on Mac OS X.2.8

 
Philip Herzer
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having problems running this basic Hello World app. It is a modification of a simple java based app that displays the text in a command line window. I got the code from Sun's Java Tutorial
Here is the actual code:

Unfortunately, I keep getting this error:

I tried it also on a Intel box running Gentoo Linux. I'm getting the same error as above.
I'd appreciate any help to fix the problem.
Thanks,
Felipe
 
Philip Herzer
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel ashamed for posting the last question. I found out that I forgot to define the main method: .
I was able to run it through a web browser without attaching the main method. But, if I were wanting to run it from the command line, where does the main method belong in above code.
Thanks for everyones help, I'm looking forward to really learning java. Just have to correlate some of the nuances of this language with Python and Ruby.
Felipe
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to JIGB.
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Felipe, welcome to JavaRanch.
In a browser you can have an Applet, from the command line you run an Application. In Sun's tutorial, Step 3 "Create Your First Applet" comes after Step 2 "Create Your First Application".
Sun's tutorial for macs
Maybe you want to go back to Step 2 and try that?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic