asad_hussain
asad_hussain

Reputation: 2011

Getting error while importing a class defined in the same project in eclipse

I went through the solution given in this question , but it's not working in my case.That's why i am forced to ask my doubt.I have created a new folder output as suggested here and put all the .class files in this folder. And then to import a specific java class ConnManager.java which i have defined in the same project,i tried this --

<%@ page import="output.ConnManager" %> 

and even this --

 <%@ page import="Summer.output.ConnManager" %>

Here output is the name of folder i created to store class files.And Summer is the name of the project. But eclipse is giving cannot be resolved error. How to remove this error ?

Upvotes: 0

Views: 1156

Answers (2)

Dhaval Simaria
Dhaval Simaria

Reputation: 1964

You need to have your output folder on Classpath. You can do so as follows:

Java Build Path > Under Libraries tab > Add Class Folder

Provide the output as class folder.

Now you will be able to import the file as <%@ page import="output.ConnManager" %>

Java Build Path

Here you add your folder containing .class files

Upvotes: 1

J.Mengelle
J.Mengelle

Reputation: 341

Well, you must use the package name of the class, not the file path.

Like :

<%@ page import="java.util.List" %>

Upvotes: 1

Related Questions