The Artima Developer Community
Sponsored Link

Java Answers Forum
Problem with Assertions in java

2 replies on 1 page. Most recent reply: Jul 26, 2004 2:48 AM by Jeroen Wenting

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
kiranv

Posts: 1
Nickname: kiranv
Registered: Jul, 2004

Problem with Assertions in java Posted: Jul 22, 2004 4:02 PM
Reply to this message Reply
Advertisement
Can anyone please tell me how should I use the four permissible forms of enabling assertions in java.

-ea:<package name>
-ea:<class name>
-ea
-ea:...

I have two source files test1.java and test2.java,so I use assertions in both the files,and these files are in A package.So my current directory shows :
C:\j2sdk1.4.2_04\bin\javaexamples\A>
And I want to enable assertions in these two files at the package level,like

C:\j2sdk1.4.2_04\bin\javaexamples\A>javac -source 1.4 test1.java //compiling

C:\j2sdk1.4.2_04\bin\javaexamples\A>javac -source 1.4 test2.java //compiling

C:\j2sdk1.4.2_04\bin\javaexamples\A>java -ea:A test1

It gives me an error of NoClassDefFoundError test1

I have checked that the class files are in the A package only.And I have set the classpath to C:\j2sdk1.4.2_04\bin\javaexamples

So what should be the problem,Please help


Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: Problem with Assertions in java Posted: Jul 26, 2004 2:47 AM
Reply to this message Reply
you're attempting to run the class from the wrong place.
Go to the root of the package tree and run A.test1

Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: Problem with Assertions in java Posted: Jul 26, 2004 2:48 AM
Reply to this message Reply
p.s. this is so basic anyone should know it.
The fact that you don't shows you've "learned" Java the wrong way, meaning using only an IDE with no exposure to the compiler or runtime.

Flat View: This topic has 2 replies on 1 page
Topic: problem in making the server program threaded Previous Topic   Next Topic Topic: Converting ArrayList to String Array

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use