Eclipse error … cannot be resolved to a type
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat.
I am getting the error: com.ibm.ivj.eab.dab.DatastoreJDBC cannot be resolved to a type.
I have the *.class files sitting inside a com/ibm/ivj/eab/dab folder (exactly how I found them). I have tried creating a jar file and adding that to the build path via "Add External Jar", I have also tried adding an "External Class Folder" and pointing to the folder that contains the "com" directory in question.
Still, the error persists. What is strange is if I start typing the package name eclipse actually auto-completes the class for me! (pictured below). Any ideas would be greatly appreciated. Maybe the classes were compiled for a much older java version and that is causing trouble? Maybe there is something I need to do to ensure the classes end up in the WEB-INF/lib directory?
I
java eclipse
add a comment |
I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat.
I am getting the error: com.ibm.ivj.eab.dab.DatastoreJDBC cannot be resolved to a type.
I have the *.class files sitting inside a com/ibm/ivj/eab/dab folder (exactly how I found them). I have tried creating a jar file and adding that to the build path via "Add External Jar", I have also tried adding an "External Class Folder" and pointing to the folder that contains the "com" directory in question.
Still, the error persists. What is strange is if I start typing the package name eclipse actually auto-completes the class for me! (pictured below). Any ideas would be greatly appreciated. Maybe the classes were compiled for a much older java version and that is causing trouble? Maybe there is something I need to do to ensure the classes end up in the WEB-INF/lib directory?
I
java eclipse
Is there an import statement in your code for the class?
– Chris Gerken
Apr 3 '13 at 18:22
@ChrisGerken no I did just add <%@page import="com.ibm.ivj.eab.dab.*"%> to the top (this is a JSP page) and also <%@page import="com.ibm.ivj.eab.dab.DatastoreJDBC"%> what is interesting is Eclipse doesn't mind the first import but marks the second as an error.
– mikey
Apr 3 '13 at 18:27
add a comment |
I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat.
I am getting the error: com.ibm.ivj.eab.dab.DatastoreJDBC cannot be resolved to a type.
I have the *.class files sitting inside a com/ibm/ivj/eab/dab folder (exactly how I found them). I have tried creating a jar file and adding that to the build path via "Add External Jar", I have also tried adding an "External Class Folder" and pointing to the folder that contains the "com" directory in question.
Still, the error persists. What is strange is if I start typing the package name eclipse actually auto-completes the class for me! (pictured below). Any ideas would be greatly appreciated. Maybe the classes were compiled for a much older java version and that is causing trouble? Maybe there is something I need to do to ensure the classes end up in the WEB-INF/lib directory?
I
java eclipse
I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat.
I am getting the error: com.ibm.ivj.eab.dab.DatastoreJDBC cannot be resolved to a type.
I have the *.class files sitting inside a com/ibm/ivj/eab/dab folder (exactly how I found them). I have tried creating a jar file and adding that to the build path via "Add External Jar", I have also tried adding an "External Class Folder" and pointing to the folder that contains the "com" directory in question.
Still, the error persists. What is strange is if I start typing the package name eclipse actually auto-completes the class for me! (pictured below). Any ideas would be greatly appreciated. Maybe the classes were compiled for a much older java version and that is causing trouble? Maybe there is something I need to do to ensure the classes end up in the WEB-INF/lib directory?
I
java eclipse
java eclipse
asked Apr 3 '13 at 18:10
mikeymikey
4,04521727
4,04521727
Is there an import statement in your code for the class?
– Chris Gerken
Apr 3 '13 at 18:22
@ChrisGerken no I did just add <%@page import="com.ibm.ivj.eab.dab.*"%> to the top (this is a JSP page) and also <%@page import="com.ibm.ivj.eab.dab.DatastoreJDBC"%> what is interesting is Eclipse doesn't mind the first import but marks the second as an error.
– mikey
Apr 3 '13 at 18:27
add a comment |
Is there an import statement in your code for the class?
– Chris Gerken
Apr 3 '13 at 18:22
@ChrisGerken no I did just add <%@page import="com.ibm.ivj.eab.dab.*"%> to the top (this is a JSP page) and also <%@page import="com.ibm.ivj.eab.dab.DatastoreJDBC"%> what is interesting is Eclipse doesn't mind the first import but marks the second as an error.
– mikey
Apr 3 '13 at 18:27
Is there an import statement in your code for the class?
– Chris Gerken
Apr 3 '13 at 18:22
Is there an import statement in your code for the class?
– Chris Gerken
Apr 3 '13 at 18:22
@ChrisGerken no I did just add <%@page import="com.ibm.ivj.eab.dab.*"%> to the top (this is a JSP page) and also <%@page import="com.ibm.ivj.eab.dab.DatastoreJDBC"%> what is interesting is Eclipse doesn't mind the first import but marks the second as an error.
– mikey
Apr 3 '13 at 18:27
@ChrisGerken no I did just add <%@page import="com.ibm.ivj.eab.dab.*"%> to the top (this is a JSP page) and also <%@page import="com.ibm.ivj.eab.dab.DatastoreJDBC"%> what is interesting is Eclipse doesn't mind the first import but marks the second as an error.
– mikey
Apr 3 '13 at 18:27
add a comment |
15 Answers
15
active
oldest
votes
Right click your project name.
Click
Properties
.Click
Java Build Path
.Click on
Add Class Folder
.Then choose your class.
Alternatively, Add Jars
should work although you claim that you attempted that.
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
5
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
2
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
|
show 2 more comments
Also If you are using mavenised project then try to update your project by clicking Alt+F5.
Or right click on the application and go to maven /update project.
It builds all your components and resolves if any import error is there.
4
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
1
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
add a comment |
To solve the error "...cannot be resolved to a type.." do the followings:
- Right click on the class and select "Build Path-->Exclude"
- Again right click on the class and select "Build Path-->Include"
It works for me.
add a comment |
Project -> Clean
can at least sometimes be sufficient to resolve the matter.
add a comment |
For maven users:
- Right click on the project
- Maven
- Update Project
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
add a comment |
- Right click Project > Properties
Java Build Path > Add Class Folder
- Select the bin folder
- Click ok
- Switch Order and Export tab
- Select the newly added bin path move UP
- Click Apply button
add a comment |
There are two ways to solve the issue "cannot be resolved to a type
":
- For non maven project, add jars manually in a folder and add it in java build path. This would solve the compilation errors.
- For maven project, right click on the project and go to maven -> update project. Select all the projects where you are getting compilation errors and also check "Force update of snapshots/releases". This will update the project and fix the compilation errors.
add a comment |
Easy Solution:
Go to
Project property -> java builder path -> maven -> find c3p0-0.9.5.2.jar
and see the location where the file is stored in the local repository and go to this location and delete the repository manually.
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
add a comment |
Solved the problem by dropping the jar into WEB_INF/lib.
add a comment |
copying the jar files will resolve. If by any chance you are copying the code from any tutorials, make sure the class names are spelled in correct case...for example i copied a code from one of the tutorials which had solr in S cap. Eclipse was continiously throwing the error and i also did a bit of googling ...everything was ok and it took 30 mins for me to realise the cap small issue. Am sure this will help someone
add a comment |
For many new users don't forget to add an asterisk (*) after your import statements if you wanna use all the classes in a package....for example
import java.io.*;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// no error
}
}
================================================================
import java.io;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// BufferedInputStream cannot be resolved to a type error
}
}
add a comment |
Solution :
1.Project -> Build Path -> Configure Build Path
2.Select Java Build path on the left menu, and select "Source"
3.Under Project select Include(All) and click OK
Cause :
The issue might because u might have deleted the CLASS files or dependencies on the project
add a comment |
Project -> Build Path -> Configure Build Path
Select Java Build path on the left menu, and select "Source"
click on Excluded and then Include(All) and then click OK
Cause : The issue might because u might have deleted the CLASS files
or dependencies on the project
For maven users:
Right click on the project
Maven
Update Project
add a comment |
First you need to update the pom.xml by adding below
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
1] Right click your project name.
2] Click Properties.
3] Click Java Build Path.
4] Check on 'Maven Dependencies' in Order and Export tabl.
In my case, previously it was not enabled. So when I enabled it my @GetMapping annotation works fine..
add a comment |
Also, there is the solution for IvyDE users. Right click on project -> Ivy -> resolve
It's necessary to set ivy.mirror property in build.properties
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f15794821%2feclipse-error-cannot-be-resolved-to-a-type%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
15 Answers
15
active
oldest
votes
15 Answers
15
active
oldest
votes
active
oldest
votes
active
oldest
votes
Right click your project name.
Click
Properties
.Click
Java Build Path
.Click on
Add Class Folder
.Then choose your class.
Alternatively, Add Jars
should work although you claim that you attempted that.
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
5
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
2
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
|
show 2 more comments
Right click your project name.
Click
Properties
.Click
Java Build Path
.Click on
Add Class Folder
.Then choose your class.
Alternatively, Add Jars
should work although you claim that you attempted that.
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
5
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
2
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
|
show 2 more comments
Right click your project name.
Click
Properties
.Click
Java Build Path
.Click on
Add Class Folder
.Then choose your class.
Alternatively, Add Jars
should work although you claim that you attempted that.
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
Right click your project name.
Click
Properties
.Click
Java Build Path
.Click on
Add Class Folder
.Then choose your class.
Alternatively, Add Jars
should work although you claim that you attempted that.
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
edited Sep 18 '18 at 17:18
Patrick Haugh
31.3k92849
31.3k92849
answered Apr 3 '13 at 18:16
KyleMKyleM
2,85873368
2,85873368
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
5
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
2
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
|
show 2 more comments
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
5
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
2
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
When I "Add Class Folder" should I pick the folder that contains the "com" directory (the great-great grandaddy) or should I pick the folder that contains the *.class files?
– mikey
Apr 3 '13 at 18:23
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
Found a different, more extensive set of packages including this one, rolled that into a jar, and so far so good. Thanks!
– mikey
Apr 3 '13 at 19:05
5
5
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
It definitely seems like eclipse can be a bit buggy when it comes to the validation of JSPs. "Turning it off and back on again" helps it regain its footing, but I also found that performing a Project -> Clean... can help as well to set things straight.
– mikey
Apr 5 '13 at 14:44
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
Which class needs to be selected here?
– Fahad Uddin
Jun 9 '14 at 21:17
2
2
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
The issue was solved after I restarted Eclipse
– Zvi
Mar 13 '17 at 7:21
|
show 2 more comments
Also If you are using mavenised project then try to update your project by clicking Alt+F5.
Or right click on the application and go to maven /update project.
It builds all your components and resolves if any import error is there.
4
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
1
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
add a comment |
Also If you are using mavenised project then try to update your project by clicking Alt+F5.
Or right click on the application and go to maven /update project.
It builds all your components and resolves if any import error is there.
4
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
1
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
add a comment |
Also If you are using mavenised project then try to update your project by clicking Alt+F5.
Or right click on the application and go to maven /update project.
It builds all your components and resolves if any import error is there.
Also If you are using mavenised project then try to update your project by clicking Alt+F5.
Or right click on the application and go to maven /update project.
It builds all your components and resolves if any import error is there.
answered Oct 28 '14 at 7:35
AKSAKS
40036
40036
4
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
1
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
add a comment |
4
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
1
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
4
4
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
Can someone explain why it is necessarily to do this? Why eclipse can't figure it out by itself?
– XMight
Mar 29 '16 at 8:19
1
1
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I'd like to echo @XMight 's question.
– Erutan409
Mar 17 '17 at 19:25
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
I had this issue and tried updating maven project countless times but it did not solve it until I deleted JDT indexes like this: [answer on How would you access Eclipse JDT index?] (stackoverflow.com/a/3898528/6359607)
– milijan
Dec 22 '17 at 11:11
add a comment |
To solve the error "...cannot be resolved to a type.." do the followings:
- Right click on the class and select "Build Path-->Exclude"
- Again right click on the class and select "Build Path-->Include"
It works for me.
add a comment |
To solve the error "...cannot be resolved to a type.." do the followings:
- Right click on the class and select "Build Path-->Exclude"
- Again right click on the class and select "Build Path-->Include"
It works for me.
add a comment |
To solve the error "...cannot be resolved to a type.." do the followings:
- Right click on the class and select "Build Path-->Exclude"
- Again right click on the class and select "Build Path-->Include"
It works for me.
To solve the error "...cannot be resolved to a type.." do the followings:
- Right click on the class and select "Build Path-->Exclude"
- Again right click on the class and select "Build Path-->Include"
It works for me.
answered Apr 21 '16 at 10:51
Amit Kumar DasAmit Kumar Das
9915
9915
add a comment |
add a comment |
Project -> Clean
can at least sometimes be sufficient to resolve the matter.
add a comment |
Project -> Clean
can at least sometimes be sufficient to resolve the matter.
add a comment |
Project -> Clean
can at least sometimes be sufficient to resolve the matter.
Project -> Clean
can at least sometimes be sufficient to resolve the matter.
answered Mar 12 '18 at 18:47
JoolJool
1,379119
1,379119
add a comment |
add a comment |
For maven users:
- Right click on the project
- Maven
- Update Project
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
add a comment |
For maven users:
- Right click on the project
- Maven
- Update Project
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
add a comment |
For maven users:
- Right click on the project
- Maven
- Update Project
For maven users:
- Right click on the project
- Maven
- Update Project
answered Mar 17 '17 at 15:44
Paulo RodriguesPaulo Rodrigues
212
212
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
add a comment |
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
For me, in addition, after running maven-update-project on all projects, I sometimes have to then do a maven-update-project on our core library. Oddly, both steps are necessary in that order.
– Curtis Yallop
Sep 25 '18 at 16:58
add a comment |
- Right click Project > Properties
Java Build Path > Add Class Folder
- Select the bin folder
- Click ok
- Switch Order and Export tab
- Select the newly added bin path move UP
- Click Apply button
add a comment |
- Right click Project > Properties
Java Build Path > Add Class Folder
- Select the bin folder
- Click ok
- Switch Order and Export tab
- Select the newly added bin path move UP
- Click Apply button
add a comment |
- Right click Project > Properties
Java Build Path > Add Class Folder
- Select the bin folder
- Click ok
- Switch Order and Export tab
- Select the newly added bin path move UP
- Click Apply button
- Right click Project > Properties
Java Build Path > Add Class Folder
- Select the bin folder
- Click ok
- Switch Order and Export tab
- Select the newly added bin path move UP
- Click Apply button
answered Jul 28 '17 at 18:43
Prashanth SamsPrashanth Sams
7,179105176
7,179105176
add a comment |
add a comment |
There are two ways to solve the issue "cannot be resolved to a type
":
- For non maven project, add jars manually in a folder and add it in java build path. This would solve the compilation errors.
- For maven project, right click on the project and go to maven -> update project. Select all the projects where you are getting compilation errors and also check "Force update of snapshots/releases". This will update the project and fix the compilation errors.
add a comment |
There are two ways to solve the issue "cannot be resolved to a type
":
- For non maven project, add jars manually in a folder and add it in java build path. This would solve the compilation errors.
- For maven project, right click on the project and go to maven -> update project. Select all the projects where you are getting compilation errors and also check "Force update of snapshots/releases". This will update the project and fix the compilation errors.
add a comment |
There are two ways to solve the issue "cannot be resolved to a type
":
- For non maven project, add jars manually in a folder and add it in java build path. This would solve the compilation errors.
- For maven project, right click on the project and go to maven -> update project. Select all the projects where you are getting compilation errors and also check "Force update of snapshots/releases". This will update the project and fix the compilation errors.
There are two ways to solve the issue "cannot be resolved to a type
":
- For non maven project, add jars manually in a folder and add it in java build path. This would solve the compilation errors.
- For maven project, right click on the project and go to maven -> update project. Select all the projects where you are getting compilation errors and also check "Force update of snapshots/releases". This will update the project and fix the compilation errors.
answered May 3 '18 at 6:37
Swati GourSwati Gour
514
514
add a comment |
add a comment |
Easy Solution:
Go to
Project property -> java builder path -> maven -> find c3p0-0.9.5.2.jar
and see the location where the file is stored in the local repository and go to this location and delete the repository manually.
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
add a comment |
Easy Solution:
Go to
Project property -> java builder path -> maven -> find c3p0-0.9.5.2.jar
and see the location where the file is stored in the local repository and go to this location and delete the repository manually.
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
add a comment |
Easy Solution:
Go to
Project property -> java builder path -> maven -> find c3p0-0.9.5.2.jar
and see the location where the file is stored in the local repository and go to this location and delete the repository manually.
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
Easy Solution:
Go to
Project property -> java builder path -> maven -> find c3p0-0.9.5.2.jar
and see the location where the file is stored in the local repository and go to this location and delete the repository manually.
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
<img src="https://i.stack.imgur.com/dROTl.png" alt="G">
edited Sep 17 '18 at 22:14
zx485
15.4k133248
15.4k133248
answered Sep 17 '18 at 21:38
Nazrul Islam RiadNazrul Islam Riad
113
113
add a comment |
add a comment |
Solved the problem by dropping the jar into WEB_INF/lib.
add a comment |
Solved the problem by dropping the jar into WEB_INF/lib.
add a comment |
Solved the problem by dropping the jar into WEB_INF/lib.
Solved the problem by dropping the jar into WEB_INF/lib.
answered Sep 8 '16 at 15:09
Andreas L.Andreas L.
1,9171521
1,9171521
add a comment |
add a comment |
copying the jar files will resolve. If by any chance you are copying the code from any tutorials, make sure the class names are spelled in correct case...for example i copied a code from one of the tutorials which had solr in S cap. Eclipse was continiously throwing the error and i also did a bit of googling ...everything was ok and it took 30 mins for me to realise the cap small issue. Am sure this will help someone
add a comment |
copying the jar files will resolve. If by any chance you are copying the code from any tutorials, make sure the class names are spelled in correct case...for example i copied a code from one of the tutorials which had solr in S cap. Eclipse was continiously throwing the error and i also did a bit of googling ...everything was ok and it took 30 mins for me to realise the cap small issue. Am sure this will help someone
add a comment |
copying the jar files will resolve. If by any chance you are copying the code from any tutorials, make sure the class names are spelled in correct case...for example i copied a code from one of the tutorials which had solr in S cap. Eclipse was continiously throwing the error and i also did a bit of googling ...everything was ok and it took 30 mins for me to realise the cap small issue. Am sure this will help someone
copying the jar files will resolve. If by any chance you are copying the code from any tutorials, make sure the class names are spelled in correct case...for example i copied a code from one of the tutorials which had solr in S cap. Eclipse was continiously throwing the error and i also did a bit of googling ...everything was ok and it took 30 mins for me to realise the cap small issue. Am sure this will help someone
answered May 22 '17 at 11:57
Harish NarayananHarish Narayanan
94
94
add a comment |
add a comment |
For many new users don't forget to add an asterisk (*) after your import statements if you wanna use all the classes in a package....for example
import java.io.*;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// no error
}
}
================================================================
import java.io;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// BufferedInputStream cannot be resolved to a type error
}
}
add a comment |
For many new users don't forget to add an asterisk (*) after your import statements if you wanna use all the classes in a package....for example
import java.io.*;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// no error
}
}
================================================================
import java.io;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// BufferedInputStream cannot be resolved to a type error
}
}
add a comment |
For many new users don't forget to add an asterisk (*) after your import statements if you wanna use all the classes in a package....for example
import java.io.*;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// no error
}
}
================================================================
import java.io;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// BufferedInputStream cannot be resolved to a type error
}
}
For many new users don't forget to add an asterisk (*) after your import statements if you wanna use all the classes in a package....for example
import java.io.*;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// no error
}
}
================================================================
import java.io;
public class Learning
{
public static void main(String args)
{
BufferedInputStream sd = new BufferedInputStream(System.in);
// BufferedInputStream cannot be resolved to a type error
}
}
answered Aug 18 '17 at 10:38
JamiscoJamisco
3791612
3791612
add a comment |
add a comment |
Solution :
1.Project -> Build Path -> Configure Build Path
2.Select Java Build path on the left menu, and select "Source"
3.Under Project select Include(All) and click OK
Cause :
The issue might because u might have deleted the CLASS files or dependencies on the project
add a comment |
Solution :
1.Project -> Build Path -> Configure Build Path
2.Select Java Build path on the left menu, and select "Source"
3.Under Project select Include(All) and click OK
Cause :
The issue might because u might have deleted the CLASS files or dependencies on the project
add a comment |
Solution :
1.Project -> Build Path -> Configure Build Path
2.Select Java Build path on the left menu, and select "Source"
3.Under Project select Include(All) and click OK
Cause :
The issue might because u might have deleted the CLASS files or dependencies on the project
Solution :
1.Project -> Build Path -> Configure Build Path
2.Select Java Build path on the left menu, and select "Source"
3.Under Project select Include(All) and click OK
Cause :
The issue might because u might have deleted the CLASS files or dependencies on the project
answered Mar 20 '18 at 14:20
sundersparkssundersparks
11
11
add a comment |
add a comment |
Project -> Build Path -> Configure Build Path
Select Java Build path on the left menu, and select "Source"
click on Excluded and then Include(All) and then click OK
Cause : The issue might because u might have deleted the CLASS files
or dependencies on the project
For maven users:
Right click on the project
Maven
Update Project
add a comment |
Project -> Build Path -> Configure Build Path
Select Java Build path on the left menu, and select "Source"
click on Excluded and then Include(All) and then click OK
Cause : The issue might because u might have deleted the CLASS files
or dependencies on the project
For maven users:
Right click on the project
Maven
Update Project
add a comment |
Project -> Build Path -> Configure Build Path
Select Java Build path on the left menu, and select "Source"
click on Excluded and then Include(All) and then click OK
Cause : The issue might because u might have deleted the CLASS files
or dependencies on the project
For maven users:
Right click on the project
Maven
Update Project
Project -> Build Path -> Configure Build Path
Select Java Build path on the left menu, and select "Source"
click on Excluded and then Include(All) and then click OK
Cause : The issue might because u might have deleted the CLASS files
or dependencies on the project
For maven users:
Right click on the project
Maven
Update Project
edited Sep 18 '18 at 15:13
answered Jun 4 '18 at 10:56
Devendra SingraulDevendra Singraul
174212
174212
add a comment |
add a comment |
First you need to update the pom.xml by adding below
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
1] Right click your project name.
2] Click Properties.
3] Click Java Build Path.
4] Check on 'Maven Dependencies' in Order and Export tabl.
In my case, previously it was not enabled. So when I enabled it my @GetMapping annotation works fine..
add a comment |
First you need to update the pom.xml by adding below
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
1] Right click your project name.
2] Click Properties.
3] Click Java Build Path.
4] Check on 'Maven Dependencies' in Order and Export tabl.
In my case, previously it was not enabled. So when I enabled it my @GetMapping annotation works fine..
add a comment |
First you need to update the pom.xml by adding below
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
1] Right click your project name.
2] Click Properties.
3] Click Java Build Path.
4] Check on 'Maven Dependencies' in Order and Export tabl.
In my case, previously it was not enabled. So when I enabled it my @GetMapping annotation works fine..
First you need to update the pom.xml by adding below
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
1] Right click your project name.
2] Click Properties.
3] Click Java Build Path.
4] Check on 'Maven Dependencies' in Order and Export tabl.
In my case, previously it was not enabled. So when I enabled it my @GetMapping annotation works fine..
answered Nov 22 '18 at 17:04
AnnuAnnu
3023621
3023621
add a comment |
add a comment |
Also, there is the solution for IvyDE users. Right click on project -> Ivy -> resolve
It's necessary to set ivy.mirror property in build.properties
add a comment |
Also, there is the solution for IvyDE users. Right click on project -> Ivy -> resolve
It's necessary to set ivy.mirror property in build.properties
add a comment |
Also, there is the solution for IvyDE users. Right click on project -> Ivy -> resolve
It's necessary to set ivy.mirror property in build.properties
Also, there is the solution for IvyDE users. Right click on project -> Ivy -> resolve
It's necessary to set ivy.mirror property in build.properties
edited Apr 3 at 11:45
answered Apr 3 at 11:02
andronandron
218
218
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f15794821%2feclipse-error-cannot-be-resolved-to-a-type%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is there an import statement in your code for the class?
– Chris Gerken
Apr 3 '13 at 18:22
@ChrisGerken no I did just add <%@page import="com.ibm.ivj.eab.dab.*"%> to the top (this is a JSP page) and also <%@page import="com.ibm.ivj.eab.dab.DatastoreJDBC"%> what is interesting is Eclipse doesn't mind the first import but marks the second as an error.
– mikey
Apr 3 '13 at 18:27