This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assert not working in my local machine

 
subramanian annamalai
Greenhorn
Posts: 22
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic