• Post Reply Bookmark Topic Watch Topic
  • New Topic

help running a .class on a mac  RSS feed

 
Mike orr
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so i've been reading out of java for dummies and it was not working out so well for me so i decided to try a book called head first java. i've been using eclipse but this book tells me to use a TextEdit program then use Terminal and javac to make it a .class file! so far i've figured out how to do this (no big feat i know but man everything seems harder on a mac!) BUT now i'm told just to run the class...i don't know how to do this? i've seen stuff saying run a JVM which makes perfect sense except for the fact that i can't find one on my mac. i saw wed sites saying it should be in the Applications file and theres nothing java related in there.


Public class MyFirstApp {

public static void main (String[] args) {
System.out.println("i Rule!");
System.out.println("The World");

}
}

i know this is nothing special but i was more doing it to try and figure out the whole compile/run part of it. any help you guys can offer would be greatly appreciated!

also I'm running OS Lion if that makes any difference!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Hmmm, I think Java on the Mac is easy-peezy. Especially if you're already familiar with a Unix command line. Or is it that you're not used to a command line at all?

Use the java command to run a Java program.

Any tutorial you find on running Java from the Unix command line should be appropriate.
 
Mike orr
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the welcome!

also i have no idea what UNIX is. i've been using the terminal (if thats the same thing feel free to laugh at me) but i'll look into some tuts on it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Terminal gives you access to the Unix command line.
 
Mike orr
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
awesome. thanks so much for the help. i've got it working now. i appreicate your help Bear Bibeault. have a good one
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!