Java to .exe

Hey,

I took two yearlong classes of Java in my highschool, and today

my mom asked me to make her a program (NOT an application!)

that will give her random numbers according to her specifications,

and write them on a .txt file. I did this in an hour, but she is asking not

to be tied down to have to use JAVA, and wants me to make this

program into a .exe file, so that she could use it on her computer

without any help from others. This completely throws me off, cause

there must be some kind of a runner program to start my .class files.

I searched on the internet ways of doing this, but everything had to

do with converting applications, not basic Java files. How would i do

this? would i try to get the JSmooth, and use that? or would i try to

make a .jar filee, and then somehow into a .exe file? If you need help,

I'll be happy to put up my code somewhere, as it is not secret, although

I do use programs from one of my classes (TextReader and TextWriter)

that let me read input, read a file, and write into a file, which I did not make.

So those i can describe to you, but i don't believe i have the power to

directly post them online.

Thank you for reading,

~patrick

[1297 byte] By [patrickera] at [2007-11-27 10:20:19]
# 1

ohh, and sorry for any misspellings or 'i's and such :D

patrickera at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 2

> there must be some kind of a runner program to start my .class files.

There is: it is called java.exe

> a program (NOT an application!)

What is the difference?

BIJ001a at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 3

You could redo the program in C. It must not be a very complicated one. There are several free C compilers.

BIJ001a at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 4

What about reading old posts of java .exe in the forum? Search button works very nice ;)

Xtremebcna at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 5

you can compile your .class to executable jar, works like .exe

but if you really insist to make an exe file then compile to jar then download jar to exe software.

Yannixa at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 6

ok... I guess I wasn't clear, mostly cause I used wrong vocabulary...

My program is not an Applet or JApplet, so I need to add to the .jar

file something to start it... and I have no idea what to add... i tried

the java.exe but i have no clue what to do... so in basic... my .jar

file isn't workin... I'm adding my javafiles' classes and the .txt file,

but i don't know what else to add... thats how limited my knowledge

is.

Thank you again for reading,

~patrick

patrickera at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 7

http://java.sun.com/docs/books/tutorial/deployment/jar/

Many IDE's will do it for you, though.

CaptainMorgan08a at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 8

Just create a BAT file or a SHORTCUT file.

the bat file is just a text file with a .bat extension.

just type this:

cd .

javaw -cp . ProgramName

pause

This assumes your java path is set. otherwise try:

cd .

C:\Program Files\Java\jdk1.6.0\bin\javaw.exe -cp . ProgramName

pause

TuringPesta at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 9

And tell your mom, good luck with the lottery.

TuringPesta at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 10

http://forum.java.sun.com/thread.jspa?threadID=645404&messageID=4351649

http://forum.java.sun.com/thread.jspa?threadID=772044&messageID=4398456

TuringPesta at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...
# 11

Thank you,

I succeeded in making a .bat file thanks to your link

and thanks to TuringPest's previous posts

patrickera at 2007-7-28 17:02:56 > top of Java-index,Java Essentials,New To Java...