Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

I keep get a resolved to a variable error

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
He is the error I am geting
and help would be great.
thank you

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
rate1 cannot be resolved to a variable

at javax.awt.event.glenhomeMortgage.init(glenhomeMortgage.java:76)
at javax.awt.event.glenhomeMortgage.main(glenhomeMortgage.java:148)

 
lowercase baba
Posts: 12986
66
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
rate1 is declared inside the try-block between lines 32-58. So when you leave the try, it falls out of scope, and therefore doesn't exist when you get to line 76.
 
Marshal
Posts: 72929
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Don't run anything from your IDE until all the compilation errors have been sorted. The error messages from the IDE are usually more helpful than the runtime errors.
Not being able to find rate1 might mean you have spelt it differently; even the tiniest error will throw the compiler. If you declared it as Rate1 and try to use it as rate1, it cannot be found. By the way: rate1 with a small r is correct.
Another possibility is that you are dealing with a local variable; if you are outwith the {} pair rate1 was declared in, it will be out of scope and inaccessible.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Glen!

Glen Lacock wrote:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
rate1 cannot be resolved to a variable


This is a strange kind of error to get - it might mean that some of your compiled class files are out-of-sync with your source code files.

Try to delete all your *.class files and re-compile all your source files again; or if you're using an IDE, try "rebuild all" to make it re-compile all your source files.
 
Campbell Ritchie
Marshal
Posts: 72929
330
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only rob is allowed to beat my by 1 minute, Fred
 
fred rosenberger
lowercase baba
Posts: 12986
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Only rob is allowed to beat my by 1 minute, Fred


1 minute, 3 seconds!!!
 
Campbell Ritchie
Marshal
Posts: 72929
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

fred rosenberger wrote:1 minute, 3 seconds!!!

Rob would have managed 0 minutes 3 seconds
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic