Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Java

  • 19-05-2011 7:42pm
    #1
    Closed Accounts Posts: 3,915 ✭✭✭


    Just decided to have a crack at learning java, have no previous experience in programming.

    I have a book called Java in Two Semesters.

    First basic program "hello world" makes use of a class called EasyIn. I think it enables user input or something. I wrote the code but got an error and realised I needed to go get this EasyIn and make it available to the compiler. Book just says put it where the compiler will look for it, the most useless explanation it could have given to be honest.

    I have Eclipse and something called DrJava. Eclipse looks mad complicated and I'm not sure if I should use that or the more basic (easier to use) DrJava.

    Long story short my question is which should I use Eclipse or the Basic one and where do I put the other classes like EasyIn so that I can use them in the code ?


Comments

  • Registered Users, Registered Users 2 Posts: 1,181 ✭✭✭ronkmonster


    Skunkle wrote: »
    Just decided to have a crack at learning java, have no previous experience in programming.

    I have a book called Java in Two Semesters.

    First basic program "hello world" makes use of a class called EasyIn. I think it enables user input or something. I wrote the code but got an error and realised I needed to go get this EasyIn and make it available to the compiler. Book just says put it where the compiler will look for it, the most useless explanation it could have given to be honest.

    I have Eclipse and something called DrJava. Eclipse looks mad complicated and I'm not sure if I should use that or the more basic (easier to use) DrJava.

    Long story short my question is which should I use Eclipse or the Basic one and where do I put the other classes like EasyIn so that I can use them in the code ?
    Been a while since I did any java, but I think you can put the EasyIn class in the same folder as your own class file.


  • Registered Users, Registered Users 2 Posts: 428 ✭✭Joneser


    You will also want to make sure that you are calling an import command up the top of your hello world class.


  • Closed Accounts Posts: 3,915 ✭✭✭MungBean


    Been a while since I did any java, but I think you can put the EasyIn class in the same folder as your own class file.

    Cool thanks icon7.gif


  • Closed Accounts Posts: 3,915 ✭✭✭MungBean


    Joneser wrote: »
    You will also want to make sure that you are calling an import command up the top of your hello world class.


    public class Hello
    {
    public static void main(String[] args)
    {
    System.out.println("Hello world");
    EasyIn.pause();
    }
    }


    I did this in a basic text editor and it worked fine with the EasyIn class in the same folder as Hello. Does the likes of Eclipse need a specific reference in the code to import it?


  • Registered Users, Registered Users 2 Posts: 428 ✭✭Joneser


    nah my bad, was thinking about importing it from a different folder in the project in case that's what ur prob was before ;)


  • Advertisement
  • Closed Accounts Posts: 3,915 ✭✭✭MungBean


    Joneser wrote: »
    nah my bad, was thinking about importing it from a different folder in the project in case that's what ur prob was before ;)

    Thanks, just needed the easiest way to get it workin.


  • Closed Accounts Posts: 5,482 ✭✭✭Kidchameleon


    Make sure the EasyIn class is actually compiled.

    eg. javac easyIn.java

    If you find an IDE confusing I would highly recommend starting to learn programming using notepad and the command line tools.


  • Closed Accounts Posts: 3,915 ✭✭✭MungBean


    Make sure the EasyIn class is actually compiled.

    eg. javac easyIn.java

    If you find an IDE confusing I would highly recommend starting to learn programming using notepad and the command line tools.

    Yeah I think I'm gonna do that, I'll get the hang of things with text editor before I start using Eclipse.


  • Moderators, Sports Moderators, Regional Abroad Moderators Posts: 2,666 Mod ✭✭✭✭TrueDub


    Make sure the EasyIn class is actually compiled.

    eg. javac easyIn.java

    If you find an IDE confusing I would highly recommend starting to learn programming using notepad and the command line tools.

    Excellent advice - you learn about things like classpaths and eliminate a lot of gotchas that way. IDEs are great when you're up & running, they provide you with a lot of shortcuts, but you need to know the logic behind them first.


  • Registered Users, Registered Users 2 Posts: 183 ✭✭selfdiy


    I agree with the others here, start using without eclipse until you understand how the basic java tools work.

    For a simple hello world application in java you shouldn't need to import another class.
    Start off by trying to get a simple program that prints hello world.
    This can be done using notepad and compiling using javac and executing using java. Then work up to include packages and then start importing other classes.

    This will help you to learn the basics.

    Eclipse is simple enough to use 90% of options it provides you wont need to use, it may look complicated at first but after awhile it becomes easy.

    If you run into any trouble compiling or running your class post it here...


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 33 frezzabelle


    For our first year in college we used BlueJ, I found it helpful in understanding object orientated concepts and it's quite visual(good for beginners). It can be debated the learning approach is flawed(click on objects to create and call methods) but its a good start, then in second year we moved to Eclipse. Good luck with it!


  • Closed Accounts Posts: 3,915 ✭✭✭MungBean


    For our first year in college we used BlueJ, I found it helpful in understanding object orientated concepts and it's quite visual(good for beginners). It can be debated the learning approach is flawed(click on objects to create and call methods) but its a good start, then in second year we moved to Eclipse. Good luck with it!

    Thanks I'll look into that icon7.gif


Advertisement