School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,149 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,875 people online right now. Registration is fast and FREE... Join Now!



how to convert a java program into an exe

how to convert a java program into an exe Rate Topic: -----

#1 mdew_47  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 02-August 08


Dream Kudos: 0

Post icon  Posted 03 November 2008 - 07:06 AM

i have done my project in java and C bridgeing through JNI, now it is asked that i give my project a complete software look, so that i could start it "just by clicking the icon with a mouse". is that possible?

i have many sites but everywhere i got it is not possible. If it is possible can any body show me the way please.
Was This Post Helpful? 0
  • +
  • -


#2 mdew_47  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 02-August 08


Dream Kudos: 0

Posted 03 November 2008 - 07:16 AM

to have a glance at my project you could go to the compiler topic in both java and c forum.
Was This Post Helpful? 0
  • +
  • -

#3 mdew_47  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 02-August 08


Dream Kudos: 0

Posted 03 November 2008 - 07:31 AM

i have done all this:

create manifest file

in that manifest file you have to mention your main class name like below.

Manifest-Version: 1.0
Specification-Title: Java Utility Classes
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: mainclassname(project)

and save it as manifest.mf and keep this file in project location.

and then you have to run the following command in DOS prompt

(go to projetlocation via command prompt)
jar cmf manifest.mf filename.jar *.*



but it is giving file not found exception and also the native method that i am using not found.
Was This Post Helpful? 0
  • +
  • -

#4 mdew_47  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 02-August 08


Dream Kudos: 0

Posted 04 November 2008 - 03:16 AM

no help yet?
Was This Post Helpful? 0
  • +
  • -

#5 mdew_47  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 02-August 08


Dream Kudos: 0

Posted 04 November 2008 - 04:09 AM

i have solved my problem, i have been able to create an executable jar file.
Was This Post Helpful? 0
  • +
  • -

#6 lordms12  Icon User is offline

  • D.I.C Regular
  • Icon
  • View blog
  • Group: Contributors
  • Posts: 335
  • Joined: 16-February 08


Dream Kudos: 275

Posted 04 November 2008 - 07:10 AM

If you are using IDE you will sure find something like "export to jar" just by simple clicks you will create the jar, then you could use programs like jar2exe or lanuch4j to convert this jar to exe

This post has been edited by lordms12: 04 November 2008 - 07:12 AM

Was This Post Helpful? 0
  • +
  • -

#7 BigAnt  Icon User is offline

  • May Your Swords Stay Sharp
  • Icon
  • View blog
  • Group: Contributors
  • Posts: 2,391
  • Joined: 16-August 08


Dream Kudos: 75

Posted 04 November 2008 - 08:10 AM

Also in the manifest file if your program needs to reference any external jar files you to add the Class-Path header.
Also if you want to create a desktop shortcut you can do this by right clicking on the desktop and in the new menu click shortcut. Specify the jar file in the field provided, and click next and enter the name ten click finish. Then you need to right click on the shortcut and click properties. In the target box is the name of the jar file. You must specify the command to run the file here. The command would be something like:
"<dir-Path>/javaw.exe" –jar "<jar-File>"

where <dir-Path> is the path to the java bin directory and <jar-File> is the jar file to run.
Was This Post Helpful? 0
  • +
  • -

#8 bbq  Icon User is offline

  • omgwtfbbq
  • Icon
  • View blog
  • Group: Contributor w/DIC++
  • Posts: 890
  • Joined: 15-May 08


Dream Kudos: 125

Posted 04 November 2008 - 10:52 AM

you could always have a batch file in the same directory....

say your file is not a .jar but a .class and you have Main.java ( Main.class after compliling) well you could create a batch file
java Main



and save it as anything.bat then once u can just double click on the file and it will open cmd and execute the command.
Was This Post Helpful? 0
  • +
  • -

#9 pbl  Icon User is offline

  • Java Lover
  • Icon
  • Group: Mentors
  • Posts: 11,168
  • Joined: 06-March 08


Dream Kudos: 475

Posted 04 November 2008 - 05:11 PM

View Postmdew_47, on 4 Nov, 2008 - 04:09 AM, said:

i have solved my problem, i have been able to create an executable jar file.

Wouldn't call a .jar as an executable.... your topic title is misleading
as Lordms mentionned their are a few programs in the web. I personnaly use Exe4J since years without problem (more than 2 thousand deployments)
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month