[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-04-28
22
Medium Priority
?
423 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:gromath
  • 9
  • 4
  • 3
  • +2
19 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16567096
why not run the jar on your pc instead of converting it to an exe?
0
 
LVL 1

Author Comment

by:gromath
ID: 16567138
how exactly do I do that?
you mean like double -clicking the file?
0
 
LVL 92

Expert Comment

by:objects
ID: 16567143
what type of application is it?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 300 total points
ID: 16567148
if you are using windowsXp then just right click on it and select openwith and select Java standard edition Binary.

else use java - jar command.

check out

http://www.cs.usfca.edu/~parrt/course/601/lectures/java.tools.html

http://www.javaworld.com/javaworld/javatips/jw-javatip127.html
0
 
LVL 1

Author Comment

by:gromath
ID: 16567157
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
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16567165
you can sepcify the class containing the main class.

java -classpath tools.jar MyClass

where my MyClass is the class having main method.


0
 
LVL 92

Expert Comment

by:objects
ID: 16567167
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/
0
 
LVL 1

Author Comment

by:gromath
ID: 16567173
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..
0
 
LVL 1

Author Comment

by:gromath
ID: 16567179
in the jar file I have .png's which are images. the metafile and some .class files
0
 
LVL 1

Author Comment

by:gromath
ID: 16567192
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
0
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 300 total points
ID: 16567688
Your .jar should contain a directory    Meta-inf
inwhich the file      Manifest.mf

with contents:

Manifest-Version: 1.0
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
Main-Class: MyClass

... if that's the class to start with.

;JOOP!

0
 
LVL 1

Author Comment

by:gromath
ID: 16568869
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
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16568907
>>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
0
 
LVL 1

Author Comment

by:gromath
ID: 16571375
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

0
 
LVL 1

Author Comment

by:gromath
ID: 16571400
meta-inf
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 300 total points
ID: 16571961
B 2.3 in the following tells you how to run it:

http://java.sun.com/j2me/docs/wtk2.2/docs/UserGuide-html/commandline.html
0
 
LVL 1

Author Comment

by:gromath
ID: 16574087
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16576571
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
0
 
LVL 92

Assisted Solution

by:objects
objects earned 300 total points
ID: 16581682
> anyways the emulator didn't do it since it is for developing apps.

Doesn't stop you using them. The app is designed to run on a mobile device, to run it on a PC you need something to emulate that environment.

> I didn't find the main class:

it won't have one

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month18 days, 5 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question