Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

I am trying to run simple static website through Jar file but not having too much luck. The reason I want to run the website through Jar because I don't want end users to access my pages directly. For example, they should not have access to index.html page directly without actually starting my program which is built using java swing.

Things I tried:

  • Jar application works if I am running on the same machine where I created Jar using Eclipse because index.html page is fetching the page from local directory. which i know is wrong.
  • If I try using different laptop or desktop then my swing application does not open any kind of index.html through my browser.

So any suggestions?

Also, I was using Desktop.open(), Desktop.browse, getClass().getResources().getURL() .. stuff that I seen on other pages.

share|improve this question

closed as off-topic by chrylis, Richard Sitze, Sergio, Frank van Puffelen, Dave Chen Aug 25 '13 at 20:22

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance." – Richard Sitze, Sergio, Dave Chen
  • "Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist" – chrylis, Frank van Puffelen
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 0 down vote accepted

You need to copy your data or use a server like tomcat, jboss etc.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.7.7.2698\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Stack Overflow works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </nosc"], "copyright__copyright__copyright": ["e problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist\" \u2013 chrylis, Frank van Puffelen\nIf this question can be reworded to fit the rules in the help center, please edit the question.\n\n1 Answer 1\n\nup vote 0 down vote accepted\n\nYou need to copy your data or use a server like tomcat, jboss etc.\n\nshare|improve this answer\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}