Question: There are [many tools for converting latex into html](http://www.tex.ac.uk/cgi-bin/texfaq2html?label=LaTeX2HTML). I'm looking for a Java or C++ program to do this. It will need to run on multiple operating systems. The solution will be used on academic papers, so it should ideally also be able to interpret things like bibtex.

I found [htmltolatex](http://htmltolatex.sourceforge.net/) which is a "Java program for converting HTML pages into LaTeX", but it doesn't seem to operate in the other direction. 

Related questions:

* [what-is-the-best-way-to-embed-latex-in-a-webpage](https://stackoverflow.com/questions/116054/what-is-the-best-way-to-embed-latex-in-a-webpage)
* [how-best-to-write-documentation-ideally-in-latex-targeting-both-the-web-html](https://stackoverflow.com/questions/409717/how-best-to-write-documentation-ideally-in-latex-targeting-both-the-web-html)

*Update:*
Just to clarify a little further: I want to distribute a package in another language that will accept any LaTeX document and produce HTML output (mostly of academic papers). I can't expect anything else to be installed (e.g. ghostscript, perl, latex2html, tth) on the machines already, and it needs to run cross platform. In other words, if I can find something that has compilable source code (or code in Java or C++) then I would rather go down that route so that the application is self contained. Alternatively, I will just use latex2html or tth and require the user to install those separately (although that's not ideal).

Answer: 
[Latex2html](https://packages.debian.org/sid/latex2html) is the way to go. You say that you don't want any dependency, but any library you'll pick will be something you'll depend on. Latex2html:

* works great,
* it's part of TeX
* it's relatively small that you can bundle the executable with your app
* it's open source (GPL), so you might also try to link it within your program and not have an external dependency (you need to release with a GPL-compatible license, though)
* support bibtex out of the box,
* understand hyperlinks (if you convert from a postscript, you'll lose the hyperlinks)

I believe it compiles on all the major platforms (Linux, Windows, Mac) - but honestly I only have Linux so I can't say for sure.
I dont know of a native Java or C++ library to do this. But, if you're generating HTML anyway, you could always use JavaScript to convert the latex to html within the document.

jsMath is great at this:

<http://www.math.union.edu/~dpvc/jsMath/>