• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Bundling Help File w/ Application

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created an HTML Help File that is accessed from "Help" on the menu bar of my program. Now that I am getting my program ready to distribute I find I have to change path to this file since users won't be able to access my Documents/Project file from their computers. This file will be included in myproject folder. How would I set up a path in this situation where users might place my program folder on various drives?

 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Include it in your JAR and access it from your program as a resource.
 
Saloon Keeper
Posts: 5617
214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is certainly possible, but it probably has the drawback that it makes the jar file very much bigger.
A rise in size from say 60KB to well over 2MB is no exception.

Besides: when I did that the first time I had the problem that this HTML file, stored as a resource, could easily be launched when the application was run in NetBeans, but not when the app was run as a jar file.

I solved it, more or less, by having the jar file and the html file in the same map, but as two different files. That had some advantages:

1) the help file could be launched separately, just by double clicking
2) the user can store the jar and the help file at any location fit
3) in my jar file, the main file did two things: determine the map it is stored in, and second, it started the real application, giving the path as a parameter. The application could then launch the html file as usual, to whatever browser the user had figured as standard.
4) I explained this situation in a very small ReadMe file.

I know, it was in my java beginning period, so I did not know any better, but I always found this way of doing satisfying. Agreed, the user base was me and at best some direct family...
 
Sheriff
Posts: 28401
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are going to be using the HTML help file by opening the default browser with a local URL on your system, then distributing it in the JAR file isn't going to be a solution. I don't think that browsers can understand jar:// URLs. But if you wanted to do this, you could distribute the jar with the HTML included inside it as a resource, then have some code in the jar copy the resource to the user's home directory before using it.

On the other hand if the HTML help file is intended to be used in a browser built in to your application, that might not apply.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic