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

Java Package Problem

Options
  • 05-04-2005 10:31pm
    #1
    Closed Accounts Posts: 26


    I'm sorry this is a very stupid question but it has been wreaking my head for awhile now.

    I have a big application (20+ classes), so I did the sensible thing and used packages for code re-use and optimisation. Everything was fine but now, when I made a few small changes (just gif changes) it won't compile. The code hasn't changed.

    From command line I get:
    ...packageA.packageB.class - cannot find class

    and then it gives out about all the methods being used in main class that came from the packed class etc.
    If I just run it, it still runs the old code without any package problem.

    Any thoughts, ideas?
    I've tried javac -d and all that. I can't use an IDE because I get the same problem there. I know that everything is where its supposed to.

    Thanks


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Can we see the new and old code for comparision, please?


  • Registered Users Posts: 7,498 ✭✭✭BrokenArrows


    by gif changes do you mean that you simply subustitued one picture file name for another.

    Are you sure that you didnt delete anything because a file name change like this would not cause an error like that.


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Jars are basically zip files. Open it in winzip (or rename to .zip and check in XP). You can see if everything is laid out correctly.

    As mentioned your change shouldn't of caused that problem.


  • Closed Accounts Posts: 26 Selket


    "by gif changes do you mean that you simply substituted one picture file name for another.

    Are you sure that you didnt delete anything because a file name change like this would not cause an error like that."

    Yep, thats what I meant and that wasn't they problem, it was how I noticed the problem. By making the change, I had to re-compile and then noticed that it wasn't finding the packages.

    But its all ok now though. I've discovered what was wrong. My sis was playing around with the laptop and I didn't notice that she had managed to change my classpath. She removed that all import '.' at the end. I could still see the jars (which is why it would still run) but neglected to notice the . gone
    *sigh*

    Thanks for the input though


  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    Check classpath is correct. Might be worth clearing CLASSPATH environment variables and doing it from the command line.


  • Advertisement
Advertisement