• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to make distributable copies of my program?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 17696
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This tiny ad is wafer thin:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic