facebook

[Closed] Adding External Jars

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244891 Reply

    lbee
    Member

    Hello,

    I am using Eclipse 3.1 and MyEclipse 4.0.3 GA. I am bringing in an external Jar which I exported from one of my Java projects so I can use some of the methods in that project. From within my jsp page I can use the editor to find the method call from the package I have imported but when I run the page it can’t find the package? These are the following errors.

    org.apache.jasper.JasperException: Unable to compile class for JSP

    Generated servlet error:
    C:\Tomcat 5.0\work\Catalina\localhost\Login\org\apache\jsp\index_jsp.java:9: package edu.us.employee.hibernate does not exist
    import edu.us.employee.hibernate.EmployeeDB;
    ^

    An error occurred at line: 20 in the jsp file: /index.jsp
    Generated servlet error:
    C:\Tomcat 5.0\work\Catalina\localhost\Login\org\apache\jsp\index_jsp.java:88: cannot resolve symbol
    symbol : variable EmployeeDB
    location: class org.apache.jsp.index_jsp
    authorized = EmployeeDB.validateNetId(line2);
    ^
    2 errors

    Also in the project I exported I do have my class public and the method as public static.

    Any help would be great.

    Thanks,

    #244911 Reply

    Riyad Kalla
    Member

    If you have a web project that relies on a Java project for libraries or class files, you need to make that Java project a dependency of the web project and also set it as a reference. MyEclipse should by default package up the project and merge it into your web project when you deploy it.

    This is covered in section 10.1 here: http://www.myeclipseide.com/images/tutorials/quickstarts/webprojects/

    #245086 Reply

    Scott Anderson
    Participant

    Lucas,

    Riyad is correct in how to make projects dependent. However, if you still want to export the jar, based on the screenshots you emailed to us, the problem is that your ucemployee project is out of sync. To correct that, select the project in the Package Explorer view, right-click and select Refresh. Once that’s done you should be able to export just fine.

    #251915 Reply

    REFRESH was key player

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: [Closed] Adding External Jars

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