aspose file tools*
The moose likes Beginning Java and the fly likes Assert not working in my local machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Assert not working in my local machine" Watch "Assert not working in my local machine" New topic
Author

Assert not working in my local machine

subramanian annamalai
Greenhorn

Joined: Mar 06, 2005
Posts: 22
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

Joined: Apr 21, 2005
Posts: 410
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

Joined: Mar 06, 2005
Posts: 22
Thanks for your reply. I am using version 1.4.

Error :

Cannot resolve symbol

Subu
Ramakrishna Nalla
Ranch Hand

Joined: Apr 21, 2005
Posts: 61
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

Joined: Apr 21, 2005
Posts: 410
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
 
subject: Assert not working in my local machine