• Post Reply Bookmark Topic Watch Topic
  • New Topic

point out the error in code attahced  RSS feed

 
harry khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
please point out the errorin code



 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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...

http://www.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
  • 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
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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...
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
i tried dubugging in eclipse.i am sharing the screenshot.
scr.png
[Thumbnail for scr.png]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!