Link to home
Start Free TrialLog in
Avatar of gromath
gromath

asked on

.jar to .exe or how to execute cellphone java games in my pc

Hello. Can anyone tell me which program I can use to convert a .jar file into an executable one? I've tried a couple of programs but no success. Anyway This is what I need: since it costs me to upload java games into my cellphone, I'd like to check 'em out on my PC before uploading them to the phone and like I mentioned they're .jar... thanks for your help
Avatar of Mick Barry
Mick Barry
Flag of Australia image

why not run the jar on your pc instead of converting it to an exe?
Avatar of gromath
gromath

ASKER

how exactly do I do that?
you mean like double -clicking the file?
what type of application is it?
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gromath

ASKER

objects: it's a .jar file.

shivaspk: tried the java standard edition library and I got an error message: "failed to load main-class manifest attribute"
will check the links
you can sepcify the class containing the main class.

java -classpath tools.jar MyClass

where my MyClass is the class having main method.


I realize its a jar file, but what type of application is in the jar file.
You need to get an emulator for the type of application that it is (ie. what is supported by your phone)

http://developers.sun.com/techtopics/mobility/midp/articles/emulators/
Avatar of gromath

ASKER

I'm sorry guys I must say I'm absolutely ignorant about how java works etc. I read the link it says "To execute a jar file, you can use the java command's -jar option." I don't get it...where do I put this command exactly? I know there's this java console but I don't know how to operate it..
Avatar of gromath

ASKER

in the jar file I have .png's which are images. the metafile and some .class files
Avatar of gromath

ASKER

shiva: " you can sepcify the class containing the main class. java -classpath tools.jar MyClass where my MyClass is the class having main method." I get it but where exactly do I put all these commands...which program??

objects: My cellphone is sony ericsson z600; the link of it's emulator in the link you gave me is broken,
i'll google it.

I realize this must be frustrating to you guys,  but bear with me, I have no idea what "class" "main class" etc. is
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gromath

ASKER

yeah it does have that file...I don't get you 100% what's the point?

anyways the emulator didn't do it since it is for developing apps.
and I don't know where to write all these commands you guys are saying (remember I have no idea how any of these things work) so I'm back where I started. Isn't there a program that does this? Just render a plain .jar to an exe or let me run the damn thing. Really, I don't wanna learn bloody  Java I just want to check the games!!  :P
>>yeah it does have that file..

Well, in order for it to have any significance, its contents must be something like sciuriware mentioned - i.e. it needs to specify a Main-Class

If you post the jar file somewhere public we can take a look at it

To get to the command line go

Start|Run

and type in

cmd.exe
Avatar of gromath

ASKER

I see where was the error communication: I never used CMD until now, I had righ-clicked the file and trie to operate it. Ok
now reading all the explanations make more sense here's a copy o a manifest from a game called witchcraft...I didn't find the main class:

Manifest-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
HIGHSCORE: www.eemo.com/bigart/Highscore.jsp
OPERATOR: eplus
MIDlet-Version: 1.0
Created-By: 1.3.0 (Sun Microsystems Inc.)
MIDlet-Vendor: ---
MicroEdition-Profile: MIDP-1.0
MIDlet-1: Hexenkueche, , hexenkueche.Hexenkueche
MIDlet-Name: Witchcraft

Avatar of gromath

ASKER

meta-inf
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gromath

ASKER

So, let me see if I have this right: I have to edit the manifest and write in it which is the main-class (the ".class" that has the game in it) is this correct? if it is how do I "zip" all the files together so they are again a .jar after I edited the manifest?

If it's wrong well I'm totally lost. I tried using the commands mentioned earlier but they didn't work...so perhaps someone could tell me how to insert them correctly (eg. if the java game name is "dots.jar" and the file I think it's the main class is named "dots.class" in what way  using the command java -classpath tools.jar MyClass will fix the problem?

I have raised the points to 295.
At this point, i'm out of my depth as i don't do J2ME, but from my swift perusal of the link i posted, their example manifests already look very similar to yours, so their instructions should work
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial