Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java program

 
Jason Collins
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a small java program that keeps track of my account. Much like a bank uses. I have no clue how to make this into a installer that after installed with create a .exe to envoke the program to start up and run. Can someone plz direct me to a post about this.. or perhaps even tell me if its possible or how to do it. I have searched now for a couple of hours about this and have seen things like netbeans that is suppose to be used for deployment. However, i still havent understood if this is gonna do what im lookin for.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java solution is an executable JAR (Java Archive) file. See this page for a tutorial...

http://www.cs.princeton.edu/introcs/85application/jar/jar.html

If you really need a Windows .exe from your Java app, there are various third-party products available (e.g., exe4j, JexePack, or JSmooth), although I don't know how well any of these work.
[ April 26, 2005: Message edited by: marc weber ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
most will create an executable stub on top of the classfiles, and either still require a JVM to be installed or packing an entire JVM into the exe or required DLLs (with the resulting massive application size).
 
Jason Collins
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.cs.princeton.edu/introcs/85application/jar/jar.html

that tutorial didnt work for me. The class file the envokes the start of my gui program is a static method. It seems to not recognize that this is the file with my MAIN method in it. I cannot get the program to start if i change this method so thats it no longer static. Y is this.. and what can i do about it? Im soo frustrated at this. Whats the point to learning java if i cant even make the programs installable for my users without going through a bunch of crap. I been tryin to figure this out since i posted this. I hear 40 different ways to do this. I will settle for the executable jar file but its not workin cause it gives me an error that the file i stated as the class file with the MAIN method in it is not the correct one. GRRR! This is mad! This is my first semester in java and I made a B but ill give it up quick if I cant distribute the programs i make easily! Thats just plain dumb.

here is the error i get when i try to run the .jar file. I probably just messed up the manifest file. Which knowing me .. isnt a hard thing to do. anyways here is the error message:

Failed to load Main-Class manifest attribute from C:\Program Files\Java\jdk1.50_02\bin\testWindow.jar


this is my Main-Class file

//********************************************
// This program creates an instance of the *
// Window class. *
//********************************************

[ April 27, 2005: Message edited by: Jason Collins ]
 
Jason Collins
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok ignorate my ranting and raving.. i fixed it. My dummie butt forgot to hit return and leave a empty line at the end of my manifest file. Like i said.. i was sure i messed it up. Thanks for listening to my ranting .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic