- This topic has 3 replies, 4 voices, and was last updated 18 years, 9 months ago by [email protected].
-
AuthorPosts
-
lbeeMemberHello,
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 errorsAlso in the project I exported I do have my class public and the method as public static.
Any help would be great.
Thanks,
Riyad KallaMemberIf 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/
Scott AndersonParticipantLucas,
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.
[email protected]MemberREFRESH was key player
-
AuthorPosts