Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Elipse necon couldnt recognize assert as key word
Elipse necon couldnt recognize assert as key word [message #1782254] Tue, 20 February 2018 23:06 Go to next message
TRAN Manh Bach Tung is currently offline TRAN Manh Bach TungFriend
Messages: 3
Registered: February 2018
Junior Member
Hi,
I have problem while coding with Eclipse Neon 3
I have assert condition in my codes, but eclipse cant recognize assert as a keyword. i've search solutions on Internet, and after enable assertions(-ea) in VM arguments, it still doesnt work. Anyone can help me?
Thank u a lot :D
  • Attachment: Adresse.java
    (Size: 3.53KB, Downloaded 28 times)
Re: Elipse necon couldnt recognize assert as key word [message #1782304 is a reply to message #1782254] Wed, 21 February 2018 14:28 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1627
Registered: July 2009
Senior Member
When you say "cant recognize", do you speak of compile errors or of no visible effect during execution?
Re: Elipse necon couldnt recognize assert as key word [message #1782456 is a reply to message #1782304] Fri, 23 February 2018 16:19 Go to previous messageGo to next message
TRAN Manh Bach Tung is currently offline TRAN Manh Bach TungFriend
Messages: 3
Registered: February 2018
Junior Member
Hi,
I'm very glad that someone answerd my questions.
I think, im speaking of compile errors. When we type some words like protected, public, if else, null, ... color of these words will change, which mean the program recognize them as keyword. But in this case, the color of assert stay the same(black). Maybe its because of my library? I use JDK 1.8 and i read somewhere that assert is defined in JDK 1.4.
I did try solution on internet(enable assertions) by adding -ea in VM argument, but it doesnt work for me.
I will wait ur response and sry for bad english :D
THank you!
Re: Elipse necon couldnt recognize assert as key word [message #1782519 is a reply to message #1782456] Sun, 25 February 2018 14:44 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1627
Registered: July 2009
Senior Member
Quote:
I think, im speaking of compile errors. When we type some words like protected, public, if else, null, ... color of these words will change, which mean the program recognize them as keyword. But in this case, the color of assert stay the same(black).


If only the color is the problem, then this is not about a compiler problem, but the editor :) (where syntax coloring takes place).

Quote:
I use JDK 1.8 and i read somewhere that assert is defined in JDK 1.4.


That keyword was introduced in 1.4 and is valid in all versions since then.
But actually, it's not the JDK that decides whether Eclipse treats assert as a keyword, but the configuration of your project. What do you see in the project's properties under Java Compiler > JDK Compliance?

Re: Elipse necon couldnt recognize assert as key word [message #1782671 is a reply to message #1782519] Tue, 27 February 2018 16:04 Go to previous message
TRAN Manh Bach Tung is currently offline TRAN Manh Bach TungFriend
Messages: 3
Registered: February 2018
Junior Member
Hello,
Under Java Compiler, i see im using JDK Compliance 1.3. Oh god i must be a fool, i did change to use JDK compliance 1.4 and now it works!!!!! Eclipse now treats assert as a keyword. Thank so much bro :D
U r real hero. U saved my project
Have a good day
Cordialement
Previous Topic:Publishing to JBoss 4.0.5 has encountered a problem
Next Topic:info lost in file conversion (vcf)
Goto Forum:
  


Current Time: Wed Sep 19 06:52:26 GMT 2018

Powered by FUDForum. Page generated in 0.03100 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top