Author Topic: Java on a mac  (Read 1508 times)

zifter

  • Traveller
  • *
  • Posts: 18
    • View Profile
Java on a mac
« on: January 19, 2009, 03:53:25 pm »
Hi guys,

I'm *attempting* to teach myself java...

I'm running on a Mac Leopard 10.5.6...


As I couldn't find any JSKs for Mac, I came across Soylatte which i've downloaded to

Users/Admin/Applications/Soylatte

I opened terminal.app and typed in the line:

edit autoexec.bat

It opened a TextWrangler file, and in it, i typed:

set path=%path%;applications\soylatte\bin
set classpath=%classpath%;.; 

Then rebooted

After that, I opened another TextWrangler file and typed up the tutorial code:

class myfirstjavaprog

   public static void main(String args[])
   {
      System.out.println("Hello World");
   }
}

And saved it as myfirstjavaprog.java in  Users/Admin/Documents/Java

next, i opened terminal.app and typed:

Admins-MacBook:~ Admin$ java myfirstjavaprog
Exception in thread "main" java.lang.NoClassDefFoundError: myfirstjavaprog


[note: the 'Admins-MacBook:~ Admin$' bit is there automatically]

Is there anyone that might be able to point out where I am going wrong? Thanks!  :)



Caarrie

  • Forum Addict
  • *
  • Posts: 3369
  • We want no UNFIXED bugs!!!!!!!!!!!!!
    • View Profile
    • PlaneShift3dMods
Re: Java on a mac
« Reply #1 on: January 19, 2009, 06:18:55 pm »
i dont anything about java but have you looked at http://www.apple.com/downloads/macosx/development_tools/javaee5sdk.html ?

Socius Rockus

  • Hydlaa Notable
  • *
  • Posts: 548
  • Wibble myself: 17years I was gone, give or take
    • View Profile
Re: Java on a mac
« Reply #2 on: January 19, 2009, 10:10:41 pm »
COMPILE!!!!!!!!!!!!!

Edit: I dunno about mac OS, but in windows cmd it's like instead of java blablabla.java (which is bad)
you do javac blablabla.java <-- compiles
then java blablabla (without the .java)  :flowers: :lol:
« Last Edit: January 19, 2009, 10:12:27 pm by Socius Rockus »

Prolix

  • Guest
Re: Java on a mac
« Reply #3 on: January 20, 2009, 05:50:10 am »
Didn't mac have its own java implementation with some other coffee themed name? I can't think what it was right now but maybe it was for older architectures, Motorola or whatnot.

Timmothy Perriwinkle

  • Hydlaa Citizen
  • *
  • Posts: 351
  • I see u lookin' at mah Periwinklez.
    • View Profile
    • The Depot that's also a Warehouse
Re: Java on a mac
« Reply #4 on: January 20, 2009, 03:49:40 pm »
Cocoa, plox.


[12:05am] XilliX: I <3 you that much

miadon

  • Hydlaa Notable
  • *
  • Posts: 934
    • View Profile
Re: Java on a mac
« Reply #5 on: January 21, 2009, 01:34:18 am »
wel you need to compile the java first using the javac command.
- MiadonCam (Refresh page to see live in game Miadon Action!!)