facebook

How to use an existing package in MyEclipse

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #236582 Reply

    rhmaier
    Member

    I’m sure this is a user error as I am new to Eclipse and MyEclipse.

    I want to use the DbConnectionBroker class from http://www.javaexchange in my application.

    In the scr directory I placed the com\javaexchange\dbConnectionBroker package

    When I try to import the package I do not seem to be able to import the package I keep getting an error message on the Imports statement that the package is not used. In my code when I try to reference the DbConnectionBroker I keep getting an error message about the class is unable to be resolved.

    Is there something else I must do in order to reference packages?

    Note: If I place the source for the above in the com\javaexchange\dbConnectionBroker package it compiles okay.

    Thanks

    #236586

    Scott Anderson
    Participant

    In the scr directory I placed the com\javaexchange\dbConnectionBroker package

    I’m trying to understand exactly what you placed there. Was it the Java source files? Was it the jar containing the classes? It doesn’t seem to be the source, because you mention this at the end:

    Note: If I place the source for the above in the com\javaexchange\dbConnectionBroker package it compiles okay.

    So, if you can be a bit more specific about exactly what you’ve got and what you’re trying to do with it and the end result you desire, we can likely help you out.

    #236630

    rhmaier
    Member

    I placed the compiled class file in /src/com/javaexchange/dbConnectionBroker.

    I am using Tomcat 4.1. Should I have placed the class in TomCat_Home/classes ?

    #236631

    Scott Anderson
    Participant

    The only way to use pre-compiled class files is by making a jar out of them and then adding them to the project and placing them on the classpath. Placing compiled classes in the source directory won’t work and placing them in the classes directory will cause them to be overwritten on the first project rebuild. Just creating a jar file and using that is the easiest solution for you.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: How to use an existing package in MyEclipse

You must be logged in to post in the forum log in