• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java program and Windows users

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to distribute a java program to Windows users, with XP or Vista. Say I have a .class file Test.class. Then I will do two things:

1) I'll tell the users to download and install java from www.java.com.

2) I'll supply a .bat file with the Test.class. What is the best command in this file: "java Test" or "start java Test"?

Will this garantee that the program will work for all users?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of messing with a script, package the classes in a jar file that you make double-clickable (by using the Main-Class attribute in the manifest). That will automatically start the JVM and run the main class.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's worth noting, though, that embedding other jars within your jar, and using them from your executable jar is not easy or well supported. If you need to do this, I would suggest looking for another solution. (app packager of some kind)
 
Ranch Hand
Posts: 95
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ooopz.
The Jars' functions are that, Brindamour.
Ok, sometimes it can get a little hard, but I believe it's the best way.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't fully understand what Andre is saying, but let's not get sidetracked by jar files. They can easily be incorporated into the application jar file by unjaring/rejaring.
 
Andre Brito
Ranch Hand
Posts: 95
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
I don't fully understand what Andre is saying, but let's not get sidetracked by jar files. They can easily be incorporated into the application jar file by unjaring/rejaring.



That's what I tried to say
Jars rocks (but some people just make their reputation looks like shit because they don't really know how to use them. I'm sorry but I'm a little bad with english :|).
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To make installation easy (so that your users don't have to manually download and install a JRE), you could use one of these installer generators to generate an installation program. Some of those in the list can automatically download and install a JRE if the user doesn't have it (or doesn't have the right version for your application).

You could also use Webstart (but your users will need to have Java already installed to use that).
[ July 14, 2008: Message edited by: Jesper Young ]
reply
    Bookmark Topic Watch Topic
  • New Topic