Win a copy of Functional Design and Architecture this week in the Functional programming 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

point out the error in code attahced

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
please point out the errorin code



 
author
Posts: 23907
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

harry khan wrote:Exception in thread "main" java.lang.Error: Unresolved compilation problem:



First, welcome to the ranch. Second, please read this...

https://coderanch.com/how-to/java/FixAllCompilerErrorsBeforeRunningTheApplication

It is much more efficient to have the compiler report the error, than running it (or asking the ranch to play compiler for you).

Henry
 
harry khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i have read it.
the problem is that there is no error being shown in eclipse before compilation.
the error comes into play only at the time of compilation
 
Henry Wong
author
Posts: 23907
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

harry khan wrote:yes i have read it.
the problem is that there is no error being shown in eclipse before compilation.
the error comes into play only at the time of compilation



Sorry, that can't happen. That error message is generated by the compiler because there is a compiler error, and it is forced to compile anyway.

If you can't see it via the IDE's editor, then I recommend using the "javac" command instead. It will output the error messages, instead of burying the compiler errors into very little red circles across lots of java files managed (and somewhat hidden) by the IDE.

Henry
 
lowercase baba
Posts: 13002
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't eclipse show little arrows or symbols next to lines it thinks have problems? I don't use it, so I can't say for sure, but I'm almost positive there is SOMETHING on your screen telling you "HEY LOOK AT THIS SOMETHING IS WRONG HERE".

update: Try going here, search for "unresolved compilation". It looks like there may be a debug option you can set that would put a breakpoint at the bad line...
 
Marshal
Posts: 73959
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course there is. There will be a little red mark with a × on. If you hover your mouse on it, you will get an error message.
 
Henry Wong
author
Posts: 23907
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

With the text editor on the Java source... On the right side is a scrollbar, if there are any errors in the file, it will show up as a red line (or box). In fact, all the errors for the file will show up here, so you can get a feel of the number of errors. Once you scroll to the location of an error, on the left side is a red X, at any lines that have errors. If you mouse over the red X, it will provide a tool tip with the error.

Also, the java file will show up on the package explorer with a red mark, to show that there are errors in the file. This means that you don't actually need to open the java source to know that there are errors there. In addition, any package or subdirectory that contains a red mark, will itself contains a red mark. This goes all the way to the top, where there is a red mark for the project.

This is done to help you locate errors, if something contains a red mark, then you expand it, and you keep expanding it (drilling down), to the Java file, and then to the lines which contains the error. Once *all* the compile errors have been fixed, then the project will not contain a red mark.

Henry
 
Saloon Keeper
Posts: 8553
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

harry khan wrote:yes i have read it.
the problem is that there is no error being shown in eclipse before compilation.
the error comes into play only at the time of compilation


Only because I'm interested in the subject: I cut and pasted your code into my Eclipse and the only thing it complained about was a missing JPEGFileFilter, which I then created, then it compiled and ran without a problem. I do get a run-time warning that it couldn't find a native wrapper because I didn't install it; still ran though.
 
harry khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:

harry khan wrote:yes i have read it.
the problem is that there is no error being shown in eclipse before compilation.
the error comes into play only at the time of compilation


Only because I'm interested in the subject: I cut and pasted your code into my Eclipse and the only thing it complained about was a missing JPEGFileFilter, which I then created, then it compiled and ran without a problem. I do get a run-time warning that it couldn't find a native wrapper because I didn't install it; still ran though.




Yes,i have not pasted the JPEGFileFilter code here.sorry for that but i am aware of that and i used it while compiling on my system.The problem is not there.
Actually with that filter code too,it is giving error.
 
harry khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

harry khan wrote:

Carey Brown wrote:

harry khan wrote:yes i have read it.
the problem is that there is no error being shown in eclipse before compilation.
the error comes into play only at the time of compilation


Only because I'm interested in the subject: I cut and pasted your code into my Eclipse and the only thing it complained about was a missing JPEGFileFilter, which I then created, then it compiled and ran without a problem. I do get a run-time warning that it couldn't find a native wrapper because I didn't install it; still ran though.




Yes,i have not pasted the JPEGFileFilter code here.sorry for that but i am aware of that and i used it while compiling on my system.The problem is not there.
Actually with that filter code too,it is giving error.





it would be helpful if you shared with me the exact code that you ran on your system without any error.
 
harry khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried dubugging in eclipse.i am sharing the screenshot.
scr.png
[Thumbnail for scr.png]
reply
    Bookmark Topic Watch Topic
  • New Topic