Link to home
Start Free TrialLog in
Avatar of hapciu
hapciu

asked on

runnig java apps

i know this is not really a java related question, but i guess many of you have come upon this problem:

i distribute my app with the JRE and a BATch file which starts the jvm (something like
"start ./jre/bin/javaw -classpath myclasspath; com.bla.bla.myMainClass")

it works ok but i don't  think it looks too professional, so i want to make it an executable somehow...
so if you know a tool for converting a bat to exe (i couldn't find one) or if you have another solution, please answer

thanks
Avatar of jimmack
jimmack

You probably need to have a look at tools like InstallAnywhere, InstallShield and so on.

Have a search on Google for:

java install tool
>> if you know a tool for converting a bat to exe

     I know several tools but if create a .exe for a java your gonna lose important and cool stuff from
     Java so If I where you I'll just create a jar file a native exe of Java Platform

1.) In creating a Jar file what you need to do is to create a " manifest.tmp" file using notepad.
     In the notepad type this:

     Main-Class : YourMainClassHere

     Comment : if your main class is = a it should look like >>

     Main-Class : a

    Then save it as manifest.tmp and put this to the folder of your classes.

2.) Then go to DOS or command promt then go to the directory of your classes
     Then try typing this to the directory of your folder :
   
     c:\jdk1.4.2\javac\bin\jar Filename.jar manifest.tmp *.class

     The jdk1.4.2 is the jdk version, dont forget to change the Filename.jar
     with your own jar name.

3.) Go to your sub directory and double click on the Jar file it should work.

Previous Question :
https://www.experts-exchange.com/questions/20774096/JAR-Question.html

Hope this helps . . .
JAVATM
Avatar of hapciu

ASKER

well i can't affort  an installer like installAnywhere, so i use the free Inno Setup wich does it job right. Which is placing all my files (my classes, the jre and my batch) in a user-sellected dir. all i want is to make my bat an exe, for distributing it.
According to the Inno Setup web page (http://www.jrsoftware.org/isinfo.php), it...

"Supports creation of a single EXE to install your program for easy online distribution. Disk spanning is also supported."

Does this not work when Java files are included?
Avatar of hapciu

ASKER

the previous answer was before i read your answer, Javatm. sorry.
i know what you mean. BUT
1. i don't care if i loose system-independency (my users will have windows)
2. having my (possibly dumb) users click a bat or click a jar is almost the same. so i want an exe

thanks for the answer and i admit the jar solution is the most elegant, but i'm kinda required to make an exe for this project.

could you direct me to those bat2exe tools you said you know ?

thanks
Avatar of hapciu

ASKER

jimmack: yes but AFTER my user installs my app, he gets a bat for running my app. i don't want that. i want to make my bat an exe ....
Ah.  I see.
ASKER CERTIFIED SOLUTION
Avatar of Javatm
Javatm
Flag of Singapore 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
You could try this to make your java an exe :

// Its a free trial
http://www.ej-technologies.com/products/exe4j/overview.html

Hope it helps . . .
JAVATM