PlaneShift

Fan Area => The Hydlaa Plaza => Topic started by: zifter on January 19, 2009, 03:53:25 pm

Title: Java on a mac
Post by: zifter 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!  :)


Title: Re: Java on a mac
Post by: Caarrie 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 ?
Title: Re: Java on a mac
Post by: Socius Rockus 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:
Title: Re: Java on a mac
Post by: Prolix 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.
Title: Re: Java on a mac
Post by: Timmothy Perriwinkle on January 20, 2009, 03:49:40 pm
Cocoa, plox.
Title: Re: Java on a mac
Post by: miadon on January 21, 2009, 01:34:18 am
wel you need to compile the java first using the javac command.