Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assert not working in my local machine

 
subramanian annamalai
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When i try to compile a small program with assert statement in it. compilation fails.

How to solve the error ?

Thanks
Subu
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well its hard to say without knowing the exact error. Which version of Java are you using? You might need to compile with the -source switch:

javac -source 1.5 HelloWord.java

Substitute 1.4 for 1.5 if that is the version you are using.
 
subramanian annamalai
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I am using version 1.4.

Error :

Cannot resolve symbol

Subu
 
Ramakrishna Nalla
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..Subu
you are using java 1.4, so to compile a assert used program:
javac -source 1.4 myprg.java

To RUN

java -ea myprg


Are you sure...! Used exact commands
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the exact error from the compiler; it might not even be an assertion problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic