Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make distributable copies of my program?

 
Agnes Lapka
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone!
I wrote a little program in Java and I'd like to give it to a few friends. My question is how do I do it? Since there are no exe files in Java, how would they run my little application? Do they need to install JVM and run it from the command line? That doesn't sound right... Please, give me some ideas...
A.
 
Junilu Lacar
Bartender
Pie
Posts: 7465
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your friends have browsers that are capable of running applets then you can make your program into an applet then make an html document that contains that applet. Put your html and your .class file on the web somewhere and your friends will be able to see.
 
Conrad Kirby
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are various websites to download a Java compiler. It probably wouldn't be too difficult to tell your friends how to run the Java application you made.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give your friends a copy of the class files. Tell them exactly what directory that you want them to put the files in.
Make a bat file that has the java commands in it. Include the classpath in the invokation command that names the directory that you told them above.
Almost all machines these days come loaded with java already. Chances are they can just double click the bat file and all will be well.
 
Agnes Lapka
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all your suggestions!
I'm affraid applet wouldn't do, because I'm accessing database from the my application ( I don't think applets can do that, unless I'm wrong...).
Cindy, your answer is exactly what I've been looking for!
Thanks!
A.
 
Agnes Lapka
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just one more thing...
Is there a way of letting the user decide in which directory they want to put those class files? Couldn't one write a small 'installation wizard' in some other language (that has exe files), store the path the user chooses and append it to the bat file?
I have absolutely no knowledge of those kinds of operations, so those questions might seem silly... But I'd like to know how professionals do it? Any ideas?
A.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At work we use a product called InstallSheild that bundles up the class files, our own copy of the JRE (to protect the application against user upgrades and damaging the generic java stuff), any properties files, image files, icons etc. It makes an executable out of the above, and when the user downloads the thing and double clicks it, a standard install routine is invoked that allows the user to specify the directory, and modifies the bat file with the chosen directory as it drops them in place. It also allows you to have a deploy routine to do stuff like set up an Icon, and put the application in the Start Menu etc.
There are other products besides that one available also.
 
sharan basu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello cindy,

according to u if we use InstallSheild for .class files,
after installing executable,class files can be decompiled(as decompilers availabe) then how to protect my source files.any
suggestions plz.
sharan

------------------
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got to a portal (like google.com) and do a search on obfuscators. The muddle up the compiled code to make it difficult (hopefully impossible) for decompilers to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic