Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Getting HTML links to work in a jar file

Thread Tools

Getting HTML links to work in a jar file

Michael J. Hudson
Posts: n/a
So, I had some HTML files in a jar file that my application was using
as help files. In those HTML files, I had links to other internal
HTML files as well as links to JPGs and such. In any case, certain
links were not working. When I unzipped the jar, and ran my
application that way (outside of the jar) everything worked fine.
What was going wrong?

The original HTML link looked something like this:

<a link href="my%20link.html">my link</a>

It took a little while, but I eventually figured out what was going
on. The %20 was messing everything up. For whatever reason, outside
of the JAR, the %20 was accurately being translated to mean a "space",
but inside the JAR it was using those characters literally, %, 2, 0.

In my case, these HTML files were created through a macro I was using
in Microsoft Word. If I wasn't doing that, I could have probably just
directly replaced the "%20" with an actual space in those "href"
attributes. When I experimented with this... this did work. However,
in my case, these links were being automatically created. So, I just
had to change the way I set things up so that all the files being
created had no spaces, e.g. I used an underline instead of a space.
And once I did that, it worked... both inside and outside of the jar.

Anyway... just passing this on into the ether in case someone else out
there ever has similar problems.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM
how to disassembly a .jar file? how to see what are the classes inside the .jar file? lucy Java 6 09-07-2004 09:54 PM