Skip to main content

Anyone developing Java ME on OS X?

8 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
James Closs

> If I use ProGuard later than 2.1 the preverifier appears to work
> OK, though apps obfuscated with ProGuard v3.x don't launch at all
> on the 7610 and those obfuscated with 4.x give a ClassFormatError
> at some point!

I seem to have sorted this - the problem in later versions of
ProGuard appears to be resolved if I use the option '-
useuniqueclassmembernames'

Apparently there's a bug on some devices which causes private and non-
private methods that have the same name to interfere. Many thanks to
Eric Lafortune for bringing this to my attention.

cheers

ps Still can't get any preverifier to work with ProGuard 2.x, though
at least I can ignore this now!

====

James Closs, Director, bitBull Ltd

http://www.bitbull.com

07771 991171

====

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

fabriziogiudici
Offline
Joined: 2006-01-04
Points: 0

Just for the record, I'm developing on J2ME with NetBeans and Mac OS X. I'm using WTK 2.2 where player.jar and preverify have been copied from MPowerPlayer. This doesn't work with all the mobility examples in NetBeans, but works with my application (with a few problems, e.g. JSR-75 doesn't work, but I can live without it).

The Rosetta suggestion would be better, though. But if I try to run preverify I get:

file preverify
preverify: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/Linux 2.6.0, not stripped
[Mistral:~/Applications/WTK2.5.2/bin] fritz% ./preverify
./preverify.linux: Exec format error. Binary file not executable.

Is there any settings that I should do for enabling Rosetta?

Thanks.

Message was edited by: fabriziogiudici

Tijl Houtbeckers

Ok I made a mistake here. The previfier is not included anymore, but
the one I mentioned is now included in the Phone ME project. I forgot
I used that one to "patch" my own WTK.

I found this out through this old guide: http://javablog.co.uk/2007/08/29/j2me-development-on-os-x/

To make it a little easier, I put the PPC executable preverify file
online here: http://www.splendo.nl/javame/preverify

I personally do development on OSX with EclipseME, using the linux WTK
with this preverify. Then I make a seperate launch configuration (as a
regular java application) for MicroEmulator.

regards,
Tijl Houtbeckers

On 17 jul 2008, at 17:23, meinterest@mobileandembedded.org wrote:

> Just for the record, I'm developing on J2ME with NetBeans and Mac OS
> X. I'm using WTK 2.2 where player.jar and preverify have been copied
> from MPowerPlayer. This doesn't work with all the mobility examples
> in NetBeans, but works with my application (with a single problem,
> JSR-75 doesn't work, but I can live without it).
>
> The Rosetta suggestion would be better, though. But if I try to run
> preverify I get:
>
> file preverify
> preverify: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
> for GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/
> Linux 2.6.0, not stripped
> [Mistral:~/Applications/WTK2.5.2/bin] fritz% ./preverify
> ./preverify.linux: Exec format error. Binary file not executable.
>
> Is there any settings that I should do for enabling Rosetta?
>
> Thanks.
> [Message sent by forum member 'fabriziogiudici' (fabriziogiudici)]
>
> http://forums.java.net/jive/thread.jspa?messageID=287332
>
> =
> =
> =
> =
> =
> ======================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body
> of the message "signoff KVM-INTEREST". For general help, send email
> to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Chris B

Could someone just explain what a preverifier is for the benefit of the
community? Is it a bytecode scan of available classes?

----- Original Message -----
From: "Tijl Houtbeckers"
To:
Sent: Saturday, July 19, 2008 12:35 AM
Subject: Re: Anyone developing Java ME on OS X?

> Ok I made a mistake here. The previfier is not included anymore, but the
> one I mentioned is now included in the Phone ME project. I forgot I used
> that one to "patch" my own WTK.
>
> I found this out through this old guide:
> http://javablog.co.uk/2007/08/29/j2me-development-on-os-x/
>
> To make it a little easier, I put the PPC executable preverify file
> online here: http://www.splendo.nl/javame/preverify
>
> I personally do development on OSX with EclipseME, using the linux WTK
> with this preverify. Then I make a seperate launch configuration (as a
> regular java application) for MicroEmulator.
>
> regards,
> Tijl Houtbeckers
>
>
>
>
> On 17 jul 2008, at 17:23, meinterest@mobileandembedded.org wrote:
>
>> Just for the record, I'm developing on J2ME with NetBeans and Mac OS X.
>> I'm using WTK 2.2 where player.jar and preverify have been copied from
>> MPowerPlayer. This doesn't work with all the mobility examples in
>> NetBeans, but works with my application (with a single problem, JSR-75
>> doesn't work, but I can live without it).
>>
>> The Rosetta suggestion would be better, though. But if I try to run
>> preverify I get:
>>
>> file preverify
>> preverify: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
>> GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/ Linux
>> 2.6.0, not stripped
>> [Mistral:~/Applications/WTK2.5.2/bin] fritz% ./preverify
>> ./preverify.linux: Exec format error. Binary file not executable.
>>
>> Is there any settings that I should do for enabling Rosetta?
>>
>> Thanks.
>> [Message sent by forum member 'fabriziogiudici' (fabriziogiudici)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=287332
>>
>> = = = = =
>> ======================================================================
>> To unsubscribe, send email to listserv@java.sun.com and include in the
>> body
>> of the message "signoff KVM-INTEREST". For general help, send email to
>> listserv@java.sun.com and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

sfitzjava
Offline
Joined: 2003-06-15
Points: 0

Hi Chris,

I'll take a shot at explaining the preverifier's purpose.
In java (SE) code is loaded into the VM. This code can come from a bounty of locations because special classloaders can be made to pull from across the net or automagically generate the code on the fly. This can be very risky business, and as such the Java specification requires that the JVM verify the code before running it. This verify process checks to insure that there has been no alteration of the bytecode, and that it meets all the requirements for security including opcode formation, and stack over/underflow checks.

But this is for SE which runs on desktop computers with cycles to spare and memory to load all this wonderful verification code, not to mention a classloader.

So JavaME wants to be as safe and secure as SE and to meet that end we need to run through the same verification process.... only for ME it is done on the desktop before it is loaded to the device, and thus the name PREverifier. But this process is not just a simple check that reads the code and reports errors, the javaME preverifier must also update the bytecode with some information that can be checked on the handset by the JVM there, so there is still a bit of the verification process that must happen on the device, but this code in the Preverifier does as much of the heavy lifting as possible so that the device can run some much simpler checks and be sure that they have not been spoofed.

The question that we have asked for years however is why must the Preverifier be a platform specific EXE file, and not just another Java application. This would make it so much easier to build and port the WTK or other mobile tools to Linux and Mac where a sizable portion of developers like to work. It is sad that Unix is the platform which is last to have the WTK ported to if at all, and it is the OS that Sun helped build, and is their hardwares' primary OS.

Hope that helps provide an understanding of Preverifier.

-Shawn

Robert Virkus

Hi James,

you could try using the preverification mechanism of ProGuard itself
(using the "-microedition" switch).
Haven't tried this myself though - I use the mPower Player preverifier
without problems...

Best,
Robert

On Jul 15, 2008, at 16:55 , James Closs wrote:

> --Apple-Mail-10--544159492
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> I've been doing the above for years and have recently come across
> some nasty problems. Basically something I installed recently (I
> think the latest Tiger security update) has stopped the ProGuard /
> Preverifier combo I was using from working. Now I can't get any
> builds out for certain devices. The latest ProGuard is working OK
> (doesn't cause the preverifier to barf) but is giving me
> ClassFormatError on some devices.
>
> Any help appreciated.
>
> And as an aside, as this is fairly OT for this list I'm thinking of
> setting up a separate mailing-list for issues relating to Java ME
> development on OS X. If anyone is interested please let me know...
>
> ====
>
> James Closs, Director, bitBull Ltd
>
> http://www.bitbull.com
>
> 07771 991171
>
> ====
>
>
> =
> =
> =
> =
> =
> ======================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body
> of the message "signoff KVM-INTEREST". For general help, send email
> to
> listserv@java.sun.com and include in the body of the message "help".
>
> --Apple-Mail-10--544159492
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
>
> > space; =
> -webkit-line-break: after-white-space; ">
> Hi,


I've been doing the above for years and have =
> recently come across some nasty problems. Basically something I =
> installed recently (I think the latest Tiger security update) has =
> stopped the ProGuard / Preverifier combo I was using from working.
> Now I =
> can't get any builds out for certain devices. The latest ProGuard is =
> working OK (doesn't cause the preverifier to barf) but is giving me =
> ClassFormatError on some devices.

Any help =
> appreciated.

And as an aside, as this is
> fairly =
> OT for this list I'm thinking of setting up a separate mailing-list
> for =
> issues relating to Java ME development on OS X. If anyone is
> interested =
> please let me know...

> 0.0px =
> 0.0px"> > Helvetica">=3D=3D=3D=3D

> 0.0px =
> 0.0px; font: 12.0px Helvetica; min-height: 14.0px">

> style=3D"margin: 0.0px 0.0px 0.0px 0.0px"> > size=3D"3" style=3D"font: 12.0px Helvetica">James Closs, Director, =
> bitBull Ltd

> font: 12.0px Helvetica; min-height: 14.0px">

> style=3D"margin: =
> 0.0px 0.0px 0.0px 0.0px"> > style=3D"font: 12.0px Helvetica"> > href=3D"http://www.bitbull.com">http://www.bitbull.com > class=3D"Apple-converted-space">=A0

> style=3D"margin: =
> 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: =
> 14.0px">

> face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px Helvetica">07771 =
> 991171

> 12.0px Helvetica; min-height: 14.0px">

> 0.0px =
> 0.0px 0.0px 0.0px"> > style=3D"font: =
> 12.0px Helvetica">=3D=3D=3D=3D

=
>


=
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =
> 3D
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body
> of the message "signoff KVM-INTEREST". For general help, send email
> to
> listserv@java.sun.com and include in the body of the message "help".
>
> --Apple-Mail-10--544159492--

--
Robert Virkus
CEO Enough Software
Sögestr. 70
28195 Bremen
Germany

Email: Robert.Virkus@enough.de
Phone: +49 - (0)421 - 8409 938
Fax: +49 - (0)421 - 9889 132
Mobile: +49 - (0)160 - 7788 203
ICQ: 194752667

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

James Closs

Hi Robert,

Thanks - I tried this but it doesn't work either. The app won't even
launch on my 7610 using this method.

If I obfuscate using Proguard v2.1 any preverifier I have tried (four
of them including the MPower one) seems to crash (see below), some of
them don't output anything but from the size of the resultant JAR it
seems they're all doing the same thing. This never used to happen!

[exec] preverify(1989) malloc: *** error for object 0x33ca50:
incorrect checksum for freed object - object was probably modified
after being freed, break at szone_error to debug
[exec] preverify(1989) malloc: *** set a breakpoint in szone_error to
debug

If I use ProGuard later than 2.1 the preverifier appears to work OK,
though apps obfuscated with ProGuard v3.x don't launch at all on the
7610 and those obfuscated with 4.x give a ClassFormatError at some
point!

So I'm pretty stumped. I think the problem is only with CLDC1.0
devices, certainly it's just with older devices. Hopefully I'll find
a solution soon!

cheers

> you could try using the preverification mechanism of ProGuard
> itself (using the "-microedition" switch).
> Haven't tried this myself though - I use the mPower Player
> preverifier without problems...

====

James Closs, Director, bitBull Ltd

http://www.bitbull.com

07771 991171

====

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Tijl Houtbeckers

Hello all,

Don't know if this has been mentioned yet, but you can use the
preverifier included with the Sun WTK for linux. It's a PPC binary but
works just fine thanks to Rosetta.

regards,
Tijl Houtbeckers

On 16 jul 2008, at 10:00, James Closs wrote:

> Hi Robert,
>
> Thanks - I tried this but it doesn't work either. The app won't even
> launch on my 7610 using this method.
>
> If I obfuscate using Proguard v2.1 any preverifier I have tried
> (four of them including the MPower one) seems to crash (see below),
> some of them don't output anything but from the size of the
> resultant JAR it seems they're all doing the same thing. This never
> used to happen!
>
> [exec] preverify(1989) malloc: *** error for object 0x33ca50:
> incorrect checksum for freed object - object was probably modified
> after being freed, break at szone_error to debug
> [exec] preverify(1989) malloc: *** set a breakpoint in szone_error
> to debug
>
> If I use ProGuard later than 2.1 the preverifier appears to work OK,
> though apps obfuscated with ProGuard v3.x don't launch at all on the
> 7610 and those obfuscated with 4.x give a ClassFormatError at some
> point!
>
> So I'm pretty stumped. I think the problem is only with CLDC1.0
> devices, certainly it's just with older devices. Hopefully I'll find
> a solution soon!
>
> cheers
>
>> you could try using the preverification mechanism of ProGuard
>> itself (using the "-microedition" switch).
>> Haven't tried this myself though - I use the mPower Player
>> preverifier without problems...
>
> ====
>
> James Closs, Director, bitBull Ltd
>
> http://www.bitbull.com
>
> 07771 991171
>
> ====
>
> =
> =
> =
> =
> =
> ======================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body
> of the message "signoff KVM-INTEREST". For general help, send email
> to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".