Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 66
Registered: ‎11-23-2009
My Device: Not Specified

J2ME or J2SE?

Hi,

 

I'm making a BlackBerry app using JDE 4.6.0. Do I have to be using J2ME or can I use J2SE? I have J2SE installed on my machine.

 

I'm a radio streaming app. I'm using some code that the predecessor at my company used to create an earlier radio streaming app. I'm updating it.

 

I know for a fact that my predecessor was using J2ME, but I have J2SE installed on my machine. When I compile the app, it loads up in my BB device just fine, it's just that the buttons don't work. It could be because his code is just not completely functional. Could it also be because I'm building it with J2SE?

 

Could J2SE be the problem here?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: J2ME or J2SE?

You cannot use J2SE to compile BB programs. The RIM platform is based on J2ME.

 

What tool set are you using?

 

New Developer
Posts: 66
Registered: ‎11-23-2009
My Device: Not Specified

Re: J2ME or J2SE?

How do I check what I'm using?

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: J2ME or J2SE?

do you use the JDE or eclipse+plugin to compile? The compiler should notify you of any non-compliant methods.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: J2ME or J2SE?

The most common development tools are the stand-alone Blackberry JDE, or Eclipse 3.4.x with the BlackBerry plug in.

 

There are other ways to get it done, but most folks use one or the other of these two.

 

 

 

New Developer
Posts: 66
Registered: ‎11-23-2009
My Device: Not Specified

Re: J2ME or J2SE?

when I type java -version into cmd, I get this:

 

Java SE Runtime Environment <build 1.6.0_17_b04>

Java HotSpot Client VM <build 14.3-b01, mixed mode, sharing>

 

I installed what I found here:

http://java.sun.com/javase/downloads/index.jsp

 

I downloaded the "JDK 6 Update 17" under the "Java SE Development Kit (JDK)" listing.

 

I got that one because this page:

http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp

 

Says this:

 

Technical Requirements

  • Windows® 2000 SP1 or later, or Windows® XP
  • Windows Vista™ (BlackBerry JDE v4.2.1 and higher)
  • BlackBerry JDE v4.5+: Java SE JDK v6.0
  • BlackBerry JDE v4.2.1 and v4.3.0: Java SE JDK v5.0 or v6.0
  • BlackBerry JDE v4.1 and v4.2: Java SE JDK v5.0
  • BlackBerry JDE v4.0 and v4.0.2: Java SE SDK v1.4
This must mean SE works, right?

 

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: J2ME or J2SE?

and how do you compile your code? or create it?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 66
Registered: ‎11-23-2009
My Device: Not Specified

Re: J2ME or J2SE?

I'm using JDE 4.6.0.

New Developer
Posts: 66
Registered: ‎11-23-2009
My Device: Not Specified

Re: J2ME or J2SE?

Okay, the app is importing some ME headers.

 

 

import javax.microedition.io.*;

 

 

import javax.microedition.media.*;

import javax.microedition.media.Manager;

import javax.microedition.media.MediaException;

import javax.microedition.media.Player;

import javax.microedition.media.PlayerListener;


I'm assuming I don't get those with my J2SE install, right? Does this mean I need to install J2ME over my existing install? 

Warning!: Invocation of questionable method: java.lang.String.<init>(String) found in: theApp.MyApp.<init>()
Warning!: member data 'Player _player' not required in class: theApp.MenuScreen

Those are the only errors I'm getting, despite having only installed J2SE and not J2ME.

I want to be very careful because I have this system configured with RIM's BB code signing keys, and I have a fast-approaching deadline leaving no time to contact them to reactivate the keys if I somehow mess it up.

Do I need to install J2ME? If so, how?

 

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: J2ME or J2SE?

you do not have to install j2me. The jde automatically uses the blackberry api, which includes j2me.

the jde itself runs in java and needs an installed j2se JRE.

 

whatever keeps your app from running, it seems not to be a j2se problem.

 

use try/catch a lot and use breakpoints in the simulator. be sure to make networking on a separate thread and use invokelater to do ui modifications from separate threads.

this should enable you to to find the error yourself.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter