• Post Reply Bookmark Topic Watch Topic
  • New Topic

executing java code  RSS feed

 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just wanted to know if I write some code and then give it to a friend who doesnt know anything abt programming etc.. How does he exectue it, like is there anyway I could have a single execuatble file that you click on and 'bobs your uncle' the code executes??

Thanks in advance
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "best" approach (i.e., the Java-esque platform independent approach) is to package your application as an executable JAR file.
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Marc,

Any idea where I can find more info on how to do this?

Regards

Zein
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?JarFiles
 
sun cheng
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most IDE have the function to make a jar file such as jbuilder,eclipse..
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers guys

Zein
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For an executable JAR to be executable, your Uncle Bob must have a Java Runtime Environment (JRE) installed on his machine, and its version must be compatible with your JAR -- for example, if you are using some 1.5 features, an older JRE wouldn't accept the class files in the JAR.
 
Subhajit Mitra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!! there is something called web-start. it works nicely

http://java.sun.com/products/javawebstart/index.jsp

i don't know much about it
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the first thing to know about WebStart is that it requires you to install a JRE, so you're back to square one!

This is not to say WebStart isn't cool. One thing it supports is making it easy to detect and upgrade desktop applications, so if you come out with version 2.0, your Uncle Bob will have no trouble moving up to it!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!