Win a copy of Pragmatic AI this week in the Artificial Intelligence 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Error in Code  RSS feed

 
Greenhorn
Posts: 27
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting below mentioned error when I copied the below code and pasted in eclipse.

"Syntax error on tokens,deete these tokens"

I do not see any problem in the code.


but I am not getting any error when I type the code in eclipse.

PS: I copied the code (inside code tags) from here (in Preview mode) and pasted in Eclipse, I don't see any error now.

Can anyone tell me what was the problem I was facing.

I have attached the screenshot of error.


Screenshot-(195).png
[Thumbnail for Screenshot-(195).png]
Screenshot shows error
 
Marshal
Posts: 5941
412
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe syntax error on line 3, which is hidden with tooltip in your provided image. However, move onto the next chapters, don't waste time, this code is fine.

And use combination of next 3 keystrokes to format and indent the code. Windows keyboard ctrl + shift + f macbook keyboard cmd + shift + f.
 
Ranch Hand
Posts: 139
4
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clean Project in eclipse when you face such kind of errors
 
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately a tooltip is covering a part of the code, so it's very hard to tell what's wrong. The code in your first post is perfectly fine and will compile successfully.
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Narayana Bojja wrote:Clean Project in eclipse when you face such kind of errors


Using command line javac (and java) is even better
 
Indu Acharya
Greenhorn
Posts: 27
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code without tooltip. I wanted to show the error that covered the line 3.


Liutauras - I wanted to know what was wrong so that it would be helpful in future when I face same error.
Screenshot-(196).png
[Thumbnail for Screenshot-(196).png]
 
Liutauras Vilda
Marshal
Posts: 5941
412
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Indu Acharya wrote:Liutauras - I wanted to know what was wrong so that it would be helpful in future when I face same error.

In the future you most likely will know what to do (there is nothing wrong with code, at least I don't see it now). Problems probably could be solved by rebuilding or update'ing project (by clicking right mouse button on the specific project you'd find such option.

In the meantime, since you're getting ready for the certification, Roel gave you a very valid advice - use command line compiler. This is what mots of the certification preparation books advice, don't they? Eclipse highlighting you errors, while nobody during the exam will do that - so better train your eyes using simple text editor with no help and command line compiler, which can be invoked from the console:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!