Bug 34566

Summary: can't get assert to work with mac os x java 1.4.1
Product: [Eclipse Project] JDT Reporter: Hal Perkins <hal>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 2.1   
Target Milestone: 2.1 RC3   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
source file AssertTest.java
none
compiled version of test file none

Description Hal Perkins CLA 2003-03-11 02:07:46 EST
I installed the Mac OS X Java 1.4.1 upgrade tonight, but have been unable to get simple 
features like assert to work properly with eclipse.  I created a simple project and selected 
java 1.4 in the complience option panel, but eclipse seems to be ignoring any and all 
assert statements, including things like "assert false" and "assert 1==0".  Programs 
containing these assertions execute as if these were noops.

So how do I get asserts and other Java 1.4.1 features to work properly on Mac OS X?
Comment 1 Jerome Lanneluc CLA 2003-03-11 05:04:04 EST
Could you please attach the .java file and the .class file corresponding to the 
class that has the assert statements?

Also which JRE are you using at runtime? Could you please paste in the command 
line used to run your program: in the Debug view, select the javaw.exe process, 
bring up the properties, and copy the command line info.
Comment 2 Olivier Thomann CLA 2003-03-11 08:34:24 EST
Are you enabling assertions with -ea on runtime?
Comment 3 Hal Perkins CLA 2003-03-11 13:12:01 EST
Created attachment 4003 [details]
source file AssertTest.java

Here's the source file.  I'll attach the .class file next.

I'm afraid I'm a very new eclipse user - trying to learn my way around for
possible use in the courses I teach at University of Washington.  I tried
running this from inside eclipse, so there are no command line arguments and I
can't find anything about javaw in the debug view.  The Debug pane reports that
it is running
/System/Library/Frameworks/Java.VM.framework/Versions/1.4.1/Home/bin/java.

I'm hoping that it will eventually be simple to configure asserts with some
combination of simple options from within the environment.  Suggestions
appreciated.  Thanks.
Comment 4 Hal Perkins CLA 2003-03-11 13:12:40 EST
Created attachment 4004 [details]
compiled version of test file
Comment 5 Hal Perkins CLA 2003-03-11 14:25:32 EST
Found the run arguments panel and adding -ea to the vm arguments got the asserts to 
work.

Please close this one out.  Sorry for the trouble.

Hal
Comment 6 Olivier Thomann CLA 2003-03-11 14:33:58 EST
This should be closed as INVALID. FIXED means that an action has been taken to
fix the problem which is not the case here.
Comment 7 Olivier Thomann CLA 2003-03-11 14:34:40 EST
This wasn't a problem with Eclipse, but rather a problem with the configuration
of the launching configuration.