Application starts IE and needs to access html inside Jar

Hi everyone,
I have a Swing application which i have deployed as an executable Jar file. One of the options i give the users within this application is the ability to view a html file in their default browser. However the html file is packaged within the jar and i cannot get Internet Explorer to target the html file when it exists inside the jar.
I fire up IE using the following command :
Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler <path to html file>" ).
The above command works no problem if my html file exists on my hard drive so for example the following works no problem:
Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler C:\test\help.html" )
I have tried the following command by getting the URL for the html file using :
URL theURL = myClass.class.getClassLoader().getSystemResource( "help.html" );
I then get a path to the file:
File aFile = new File( theURL.getFile() );
String htmlFile = aFile.getAbsolutePath();
and execute the command
Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler" + " " + htmlFile )
However this was not successfull either.Can anyone tell me how i might get internet explorer to display a html file which is packaged within a jar.
Thanks :)

An idea. Never tried anything like this myself, so don't know if it will work. Don't see why it shouldn't though.
A jar file is just a file in the zip format so write some code that uses the tools in java.util.zip to unpack the jar (or just specific contents) to somewhere like /temp
Then use the runtime exec to start the browser with the argument /temp/file.html
Hope this helps.

Similar Messages

  • Attachments: I am creating an online application for employment and need applicant o submitt credentials, Is thier a way they can attach docs to the application?

    Attachments: I am creating an online application for employment and need applicant o submitt credentials, Is thier a way they can attach docs to the application?

    Hi Syclopz88,
    You can use 'File Attachment' option in the form which will allow the user to attach documents to the application.

  • Hi I am getting an update failed message (49) when trying to update photoshop after installing and whenever I start photoshop and try to access the file menu it crashes

    Hi I am getting an update failed message (49) when trying to update photoshop after installing and whenever I start photoshop and try to access the file menu it crashes

    Duplicate thread.

  • I have the Aiport T-2 and need to access it outside my home for checking my security cameras and can't seem to get it done. With my Linksys I had no problems. Any suggestions?

    I have a Airport T-2 and need to access it with my IPhone using Verizon outside the home Wi Fi on my 4S. Any ideas as with the old Linksys it was no problem.

    Have you forwarded the required ports?
    How are you doing remote access from phone?
    The TC is designed to work with BTMM and iCloud but that is not available to the iphone.
    Look at Tesserax's work on remote access and port mapping here.
    https://discussions.apple.com/community/wireless/airport?view=documents
    Good luck!!

  • I have a MacBook Pro (2011) and need to access Microsoft word documents. Is there any way to do this??

    I have a MacBook Pro (2100) OS 10.7.5 and need to access some Microsoft Word documents- but that is no longer supported in my 10.7.5 - is there any way around this????

    Miss Pamela wrote:
    I have a MacBook Pro (2100) OS 10.7.5 and need to access some Microsoft Word documents- but that is no longer supported in my 10.7.5 - is there any way around this????
    Sure, download the free/donationware LibreOffice.
    https://www.libreoffice.org/
    Cross platform and loaded with goodies.

  • I am using Lightroom 3 and need to access a catalog I created with a trial version of Lightroom 4.

    I need to access a catalog I created with a trial version of Lightroom 4.  I am currently using Lightroom 3.  Can someone help me find a way to get my images from this catalog?  I don't want to upgrade at this point as I am running on a mid 2007 iMac and would need to buy new RAM, upgrade my OS, etc....  I would rather wait and spend the money on a new system when I'm ready.

    Hi Rikk,
    I just saw your answer to Deborah,
    Does this mean catalogs not backward compatable in regards to metadata and keywords as well?
    I am working on a giant archiving project here in India. The main system here is a Mac G5 Tower at 10.6.8, and it's running LR 3.2.  I have my MacBook  Air here, running Mavericks and LR 4.4.1.
    I want to take the archive catalog OFF of LR 3.2, put it on the Air, running 4.4.1 - then ADD metadata and keywords to the catalog images while on the Air and THEN re-install/import/export/etc the catalog back to the main tower LR 3.2 with out starting a huge problem of version/upgrades/etc. That way another person can be using the tower to scan while I do keywords.
    I have only a week more here for this project. If anyone knows asap would be great. Thanks in advance.
    Barbara

  • I am an emergency physician and need to access patients iphone that is locked and they can not provide code.  Can anyone help??

    I am an emergency room physician and need access to patients iphone for phone list to call emergency contact.  Can anyone help me unlock?

    I am afraid that without the passcode you cannot unlock it

  • I am studying in Spain and need to access to a Spanish dictionary, spellcheck and grammer check in Word for Apple.  Can anyone help?

    I have been unable to download a dictionary, and then have access to it through Word. I don't know how to do this correctly.  Can anyone help?

    If I were you, I'd try posting here - http://answers.microsoft.com/en-us/mac/forum/macword.
    I'm certain that there are Spanish dictionaries and thesauri available for Word. I believe that they even come standard with the installation disc and that you can choose to install them. But best to go to the Word experts, I think.
    Good luck,
    Clinton

  • Accessing files inside JAR

    Hello !
    I have a HTML file inside a JAR file. The HTML file uses images and stylesheet located in the same dir in the JAR.
    I need to access the HTML file so that I can open it in a JEditorPane for displaying as a normal HTML. I've been trying to access it with some examples i've gotten from the forum from previous posts, without any success. Could someone PLS post me some examples or point me to a webbie with some tutorial.
    I've already tried the following:
    editorPane = new JEditorPane(this.getClass().getResource("/file.html"));Oh, it is a stand-alone application, and all the files are in the same JAR. =)

    Try it this way:
    editorPane = new JEditorPane(ClassLoader.getSystemResource("file.html"));
    -Ron

  • Very n00b error....just started programming and need help?!?!

    Hi i just started programming in java.
    im running j2se 1.5.0 on windows xp
    im on the subject of classes and objects.
    here is my simple little code im trying to get to compile
    public class Newprog
         public static void main(String[] args)
              Greeter myObjectGreeter = new Greeter();
              myObjectGreeter.sayHello();
    }now here are the error messages i get:
    --------------------Configuration: <Default>--------------------
    C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find symbol
    symbol : class Greeter
    location: class Newprog
    Greeter myObjectGreeter = new Greeter();
    ^
    C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find symbol
    symbol : class Greeter
    location: class Newprog
    Greeter myObjectGreeter = new Greeter();
    ^
    2 errors
    Process completed.
    ok i get this error message alot....well actually just about everytime..
    I got it working just once using texteditor but have no clue how i did it that time...now nomatter what i try i get this error
    I have my enviornmental variable set at
    path = C:\Program Files\Java\jdk1.5.0_07\bin;
    i am using JCreator Le
    i downloaded exact codes from websites and they still compile with this error..
    if anybody with patience could tell me what i need to do
    would i have to configure java some more with variables?
    is my installation wrong?
    do i have to save the work on a different file?
    thanks in advance

    Hi i just started programming in java.
    im running j2se 1.5.0 on windows xp
    im on the subject of classes and objects.
    here is my simple little code im trying to get to
    compile
    public class Newprog
         public static void main(String[] args)
              Greeter myObjectGreeter = new Greeter();
              myObjectGreeter.sayHello();
    }now here are the error messages i get:
    --------------------Configuration:
    <Default>--------------------
    C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5:
    cannot find symbol
    symbol : class Greeter
    location: class Newprog
    Greeter myObjectGreeter = new
    Greeter();
    ^
    s\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find
    symbol
    symbol : class Greeter
    location: class Newprog
    Greeter myObjectGreeter = new
    Greeter();
    ^
    get this error message alot....well actually just
    about everytime..
    I got it working just once using texteditor but have
    no clue how i did it that time...now nomatter what i
    try i get this error
    I have my enviornmental variable set at
    path = C:\Program Files\Java\jdk1.5.0_07\bin;
    i am using JCreator Le
    i downloaded exact codes from websites and they still
    compile with this error..
    if anybody with patience could tell me what i need to
    do
    would i have to configure java some more with
    variables?
    is my installation wrong?
    do i have to save the work on a different file?
    thanks in advance
    Well here is all that goes
    As you said you were pretty new
    I suspect the following error done by most of the novice programmers in JAVA
    Where is the Greeter class ??
    ok may be you must have defined it somewhere else
    Mostly the Java Compiler hasnt found out your Greeting class
    Try locating that " Greeter.java"
    or mention it in an other file located in the same folder as "Newprog.java"
    public class Newprog
         public static void main(String[] args)
              Greeter myObjectGreeter = new Greeter();
              myObjectGreeter.sayHello();

  • After installing 10.4.1 on my iMac G5, i cannot start iTunes and need an earlier version.  Help

    I cannot any longer access my music and movies on my iMac G5.   I cannot run Lion and, in error I updated to iTunes 10.4.1 which apparently needs Lion to run.   I have deleted the newer version of iTunes and trierd to install 9 but the library was set up by 10.4 or 10.3 and so it cannot load the music.   Help!

    iTunes 10.4.1 will run on Sno Leopard.
    Macintosh Hardware
    Mac computer with an Intel, PowerPC G5 or G4 processor
    Intel, PowerPC G5 or 1.0GHz PowerPC G4 or faster processor is required to play Standard Definition video from the iTunes Store
    2.0GHz Intel Core 2 Duo or faster processor is required to play HD video, an iTunes LP, or iTunes Extras from the iTunes Store
    512MB of RAM; 1GB is required to play HD video, an iTunes LP, or iTunes Extras
    Screen resolution of 1024x768 or greater; 1280x800 or greater is required to play an iTunes LP or iTunes Extras
    Playing videos also requires at least 16MB of video RAM
    Broadband Internet connection to use the iTunes Store
    Apple combo drive or SuperDrive to create audio, MP3, or back-up CDs; some non-Apple CD-RW recorders may also work.
    Apple SuperDrive to back up your library to DVDs; some non-Apple DVD-RW drives may also work.
    Macintosh Software
    Mac OS X version 10.5 or later
    QuickTime 7.6 or later
    Support for HE-AAC requires QuickTime 7.6.4 or later
    Safari 4.0.3 or later
    200MB of available disk space
    MJ

  • Changed server and need to access my old emails

    Hi i have recently changed hosting from BC to Wix and i need to get my old emails back. I paid for a full years worth of hosting so i know they are still there. Can i access them through webmail or do i have to point the website back to BC to retrieve them. Any help would be greatfully appricated
    Thanks
    Danny

    Hey 5starcruises,
    Can you see if you're able to log into your old webmail accounts using the following URL? - http://mail.5starcruises.com.au.cust.b.hostedemail.com/mail
    Cheers.

  • Application starting up and nothing else upon booting

    Hi Pros,
    I have an application that need to be booted up and nothing else. Whenever my computer or Windows 7 machine boots up, it should open the hospital application directly and nothing else. Nothing should be presented to the customer other than the application.
    When the customer close the application, the operating system should log him off.
    Regards,
    Abuyasir

    Hi,
    Yes, you can set customized application, such as hospital application, to achieve your goal.
    Go to the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    In right-side pane, look for String value Shell. Its value would be set to explorer.exe. Double-click on it and change its value to your customized app path or to desired 3rd party shell program's full path.
    Restart your system and get ready to boot into your desired shell program.
    Quote: When the customer close the application, the operating system should log him off.
    It can be finished by customized shell program, you can contact to application provider for more help.
    Andy Altmann
    TechNet Community Support

  • TS1368 I am trying to update my new iphone, and need to access my itunes account from a different computer.  How do I do this?

    I have a new Iphone 5 that I am trying to sync with my existing itunes account.  I need to get this to sync to a different computer, than what I originally set it up on.  Every time I plug it in, it takes me to my daughters itunes account, and wants to sync up with her music.  How do I change the itunes account?

    Hey Mike, just sign in the iTunes Store and authorize your account on this machine (don't worry, you'll be asked for it), then you will ready to use it.

  • I've installed Firefox but don't have the Firefox folder in Application Support (but I need to access this to edit my profile since Firefox won't open)

    Online troubleshooting tells me I have to go into my profile to edit something in order to get Firefox to launch. For now, it's telling me that only one copy of Firefox can be open at once. However, I don't have the Firefox folder in my Application Support, even though I've installed Firefox.
    == This happened ==
    Every time Firefox opened
    == I reformated my computer and wanted to download Firefox ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; fr-fr) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16

    I get the same thing with Firefox, IE8, Opera, and Safari. It isn't a Firefox only problem.
    Are you new to that webhosting service? <br /> Have you ever uploaded web pages to that same web hosting service previously, pages that worked after an upload? <br /> Are those pages listed as ''' "public" ''' pages in your web hosts control panel?
    My suggestion is to "download" your homepage and associated files & images from your PC, up to the server, using your web hosts control panel and see how that works.
    Beyond that, I suspect that you might have missed an important setting in Dreanweaver for uploading to the web host's server. You might try asking about this issue at a Dreamweaver support forum.

Maybe you are looking for