Damn fool newbie struggling to learn Java!

Discussion in 'General Mac Discussion' started by geese, Oct 6, 2004.

  1. geese macrumors 6502a


    Oct 23, 2003
    London, UK
    I'm in a bit of a pickle!

    I have to learn Java for my uni course- not easy when I dont know alot about it. Here we use Borlands JBuilder on Windows to compile code.

    But I need to practice at home on my eMac (Panther). I'm struggling with the software. I've tried to download to jBuilder for OS X, but when I try and run it, it just quits out after 10 seconds. I'm sure I've registered the program right and made sure the path its in hasn't got spaces in.

    So I looked through the threads and saw jBird recommended. Downloaded it and managed to type in the example code I got from uni (just a program thats prints 'Hello' on the screen). When when it compiles the code, I dont know how to execute it. It just says 'Compile Process Completed'. It worked at UNI, how do i get it to execute!

    Could someone pleeese assume that I'm a simple buffoon and give me precise instuctions on what I should do.http://forums.macrumors.com/images/icons/icon11.gif

    EDIT: Just realised, its 'JCREATOR' that we use at uni, not JBuilder. oopps.
  2. Logik macrumors 6502a

    Apr 24, 2004
    the easiest way to do this is to use xcode for home and jbuilder for school. all you'll need to do is create a blank project and insert the *.java files into the project... then compile... pretty easy stuff really.

    A few things about java though.. class files (MyJavaApp.java for example) will need to contain a MyJavaApp class in that file.. it's case sensitive so you can't have myJavaApp or myjavaapp.java and the class name in that file be MyJavaApp ... i recommend checking out Deitel & Deitels book called "Java: How to Program" ... good book, rather expensive. but i fyou want to do java programming.. get it.. great book.

    if you have any other questions post here or private message me.

    EDIT: you WILL need to install the xcode tools and such for it to even compile on your mac.. that contains the JDK and stuff.. the Runtime doesn't include the java compiler... just the interpreter (virtual machine)
  3. abhishekit macrumors 65816


    Nov 6, 2003
    akron , ohio
    Well IMHO using xcode may not be such a good idea. When I was starting, it was very confusing to me. I use Netbeans instead.
    Coming to your question, I have not usd JBuilder, but there must be 'execute' or 'run' somewhere in the menubar. Else, goto the folder in which JBuilder stores the class files by default. See if you have a HelloWorld.class or whatever you named your code.class. Then from the terminal goto that folder . And write 'java Filename'. This would run it.
  4. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    If you're really using JBuilder on Mac OS X and it's quitting, you need to make certain that you've followed the instructions in the e-mail they sent you. There is an authorisation file attached to the e-mail that allows JBuilder to continue.
  5. cluthz macrumors 68040


    Jun 15, 2004
    Haven't used jBuilder, but this i basic java programming i would use a plain text editor, like textedit, bbedit, subethaedit (my fav.) or emacs.
    you can compile in the Terminal >javac filename.java
  6. coconn06 macrumors regular

    Jun 14, 2003
    King of Prussia, PA
    I'm not sure why you need/want to use software with a GUI to learn Java, but I would suggest just compiling and running your Java code from the Terminal.

    To compile: "javac HelloWorld.java"
    To run: "java HelloWorld"

    That will work in most cases, for your purposes (gets a little more complicated when you start using packages and classpaths)
  7. jeremy.king macrumors 603


    Jul 23, 2002
    Fuquay Varina, NC
    Just a reminder that we now have a programming forum at http://forums.macrumors.com/forumdisplay.php?f=73

    As for your problem. Learn the basics using Terminal (as many suggest) and then try to work your way into an IDE. If you must use an IDE yesterday, try Eclipse - its free.
  8. Logik macrumors 6502a

    Apr 24, 2004
    I've not had a single problem with Xcode.. i use it to develop my java apps for my java class as well... eclipse turned me off last time i used it... horrid application. netbeans is another ridiculously nasty app... xcode or terminal for me...
  9. geese thread starter macrumors 6502a


    Oct 23, 2003
    London, UK

    I've managed to handle using BlueJ now. Its quite a simple app and will do for now.

    That Terminal method sounds like a good idea, shame then I dont know the first thing about the Terminal then! Does look intruiging though.

    As for JBuilder, i did follow the instructions and tried to use the autherisation file. No avail. Probably my fault somehow.

    Thanks for the help though. I've got a more pressing problem now though, my eMac keeps sleeping randomly! I think I;ve got a 'Friday Afternoon' model. Thats for another thread though.
  10. Blackheart macrumors 6502a


    Mar 13, 2004
    In my intro CSE classes, we used Dr. Java. In my more advanced class now, we are using Eclipse.
  11. Logik macrumors 6502a

    Apr 24, 2004
    If unfamiliar with unix and terminal stuff you may wish to check http://www.oreilly.com/catalog/lunixpanther/ that out if you would like to buy a book to learn.. otherwise it's available for free online in many other ways using man pages and such..
  12. BoneyardBoy macrumors member

    Jun 10, 2004
    Under the sea
    hey geese. good luck with learning java. i've only just started a course on it at college and it's a bit grrr at times but i'm managing. just keep practising! :) (i'm using bluej on my mac at home)

Share This Page