• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The import java.xxx cannot be resolved and String cannot be resolved to a type

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I open Eclipse this morning and none of the normal java imports cannot be resolved. It is was something external that I downloaded and added a jar file, it is not giving the error. I am also getting an error for Strings (String cannot be resolved to a type).

Anyone know what is going on with my Eclipse. Everything was find yesterday. When I left, I closed Eclipse and shutdown the computer.

So far any searching I have done has only resulted in explanations regarding imported jar files.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know.
Have you tried running your app from the command line?
What is your system PATH? Where have you installed Java®? Which version? Does Eclipse support Java8?
Where are you putting those other files you want to import?
 
Raymond Gillespie
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Don't know.
Have you tried running your app from the command line?
What is your system PATH? Where have you installed Java®? Which version? Does Eclipse support Java8?
Where are you putting those other files you want to import?



I have not tried running it from the command line. I have never tried that in fact.

System PATH to what?

Java looks like it is installed C:/Progam Files/Java and is version 7. I don't know if Eslipse supports Java8 or not but since I don't have that, would it matter?

The external jar files that are imported are in the WebContent/WEB-INF folder. Again, there are not the issue. It's all the internal stuff.

I did try setting a new Jave EE project and the same problem occured although when I create a regular Java project it worked fine.

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right-click on your errant project in Eclipse and choose Properties --> Build Path from the menu, then click on the "Libraries" tab. Do you see a JRE system library listed there? If not then that could explain the problem, and you'll need to add the missing library for your chosen JRE. Why did this suddenly stop working? I dunno- Eclipse can be a trying and fickle beast at times.
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have never found Eclipse fickle, but I tried after posting and it still seems not to support Java8. As you say, that is not an issue if you don't actually have Java8. If you can't sort it out by setting the JRE location for the project, can you run anything from the command line?
 
Raymond Gillespie
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So just to let you guys know what happened, my company did an update and updated my version of Java from 6 to 7, which was not compatible with what I was working on. I had to reinstall version 6 to get everything working again.
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Surely Java7 is compatible because Java® always supports backwards compatibility.
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:I have never found Eclipse fickle, but I tried after posting and it still seems not to support Java8. As you say, that is not an issue if you don't actually have Java8. If you can't sort it out by setting the JRE location for the project, can you run anything from the command line?


I was reading a recently released book yesterday and it said that Eclipse is normally a few months behind when supporting new releases. Eclipse Luna will support Java 8 and its release date appears to be late June.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joanne Neal wrote:and its release date appears to be late June.


More than "appears to be" . Eclipse has been very good at meeting their annual release train date. The release candidate is available now if someone wants to try it earlier than late June.
 
Squanch that. And squanch this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic