I am having Html help files inside my Jar file

Dear Friends;
i am having Html help files inside my Jar file.
how will open the html file using Java Help.
Thank u

http://java.sun.com/products/javahelp/reference/docs/index.html

Similar Messages

  • How to read, write file inside the JAR file?

    Hi all,
    I want to read the file inside the jar file, use following method:
    File file = new File("filename");
    It works if not in JAR file, but it doesn't work if it's in a JAR file.
    I found someone had the same problem, but no reply.
    http://forum.java.sun.com/thread.jsp?forum=22&thread=180618
    Can you help me ? I have tried this for all night !
    Thanks in advance
    Leo

    If you want to read a file from the JAR file that the
    application is packaged in (rather than a separate
    external JAR file) you do it like this ...
    InputStream is =
    ClassLoader.getSystemResourceAsStream("filename");Better to use
    this.getClass().getClassLoader().getResourceAsStream();
    From a class near to where the data is. This deals with multiple classloaders properly.

  • Java Files inside the jar file cannot be read or accessed through Eclpse

    The Java File inside the jar file of the eclipse cannot be accessed through the Eclipse . It shows error for the modules in the jar file .
    But when compiled with adding the jar files to the class path the compilation is successful .
    How can i browse through the files in the jar like going into the function definition .
    TIA ,
    Imran

    Open MPlayer OSX and show the playlist (command-shift-p) then drag the file into the playlist. Click the file in the playlist and click the "i"nfo button. What does it list for file, video and audio format?
    Not all of the codecs used in avi and wmv files are available for OS X so I'm guessing your file happens to be using one that isn't...

  • How to read a file inside the JAR file

    Hi All,
    I want to save some preferences in a file called "preferences". I kept the preferences file under my java package.
    If i am running the code inside the NetBeans 6.9 IDE it's working file. But once i have created a JAR and try to run the application, it couldn't find the path.
    Please help me that how to resolve this issue. I don't want to save this preferences file outside of my JAR (i.e) within my java package.
    Here is the code,
    package mypackage;
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    public class ReadFile
        private void writeFile()
            try
                OutputStream out = new FileOutputStream(getClass().getClassLoader().getResource("mypackage/preferences").getPath().replace("%20", " "));
                PrintWriter writer = new PrintWriter(out);
                writer.println("Hello Java!");
                writer.close();
                out.close();
            catch (Exception ex)
                System.out.println(ex.getMessage());
        private void readFile()
            try
                FileInputStream fi = new FileInputStream(getClass().getClassLoader().getResource("mypackage/preferences").getPath().replace("%20", " "));
                BufferedReader br = new BufferedReader(new InputStreamReader(fi));
                System.out.println(br.readLine().trim());
                br.close();
                fi.close();
            catch (Exception ex)
                System.out.println(ex.getMessage());
        public static void main(String[] args)
            ReadFile read = new ReadFile();
            read.writeFile();
            read.readFile();
    }If i run the JAR, i get the following error message,
    {color:#ff0000}*file:\my jar path\jarname.jar!\mypackage\preferences (The filename, directoryname, or volume label syntax is incorrect)*{color}

    Thanks sabre150,
    sabre150 wrote:
    You cannot update a running jar file. I am sorry. I didn't know about it. Thanks to point out.
    There are two ways I approach this depending on my exact requirements -
    1) use the java.util.prefs.Preferences APII will try this one
    >
    2) if not already present I copy the preferences file from the jar to a known place. I use a directory in the user's home directory and normally make the directory name the program with a '.' prefix.
    One cannot access files in a jar file using the File API. One needs to use the getResource() or getResourceAsStream() methods on Class or ClassLoader.

  • Extracting and updating files inside a JAR file... from my code

    Hi.
    I need some help in the following:
    from my code, I need to search a JAR file, open it, unzipped it, then I need to search a xml and property files inside the JAR, after that I need to modify the files and finally, my code has to save the changes and update the JAR file. All that must be from my java code.
    How can I do that? I am trying to use Runtime.getRunTime().exec().... but I am not sure that it works. Besides, I don�t know what command to include in the exec() method. Is there any way to do that?
    Thanks

    The normal reason I see for this requirement is that people want to update a properties or data file. The approach I use it that I first look for the data file in a well defined location and if I find it I use it and update it as required. If I don't fine it I create it base on a template file read from the jar file using getResourceAsSrream().
    In this way I never have to update the jar file.

  • Include and call an .exe file inside my jar file

    Hi.
    I want to include an exe file and call it inside my jar file. this is the code.
    InputStream is = getClass().getResourceAsStream("/native/my.exe");
              int[] line = new int[is.available()];
              File myFile = File.createTempFile("my","exe");
              myFile.deleteOnExit();
              myFile.setExecutable(true);
              FileOutputStream out = new FileOutputStream(myFile.getAbsolutePath());
              int i = 0;
              int c;
              while((c=is.read()) != -1){
                   line=c;
                   i++;
              is.close();
              for(int j= 0;j<line.length;j++)
                   out.write(line[j]);
              out.close();
    So i store it in my temp folder. Than i run
    String myFileLocation = myFile.getAbsolutePath();
    p = rt.exec(myFileLocation);
    Everything goes fine, but the behaviour of the .exe file is not the same. I mean when i run the commands
    PrintWriter writer = new PrintWriter(p.getoutputStream());
    writer.println("command");
    the behaviour is not the same. What goes wrong.

    But to load the xml file I need to create a File objectIf this is true then you will not be able to load the XML file, since a jar entry is not a File object and cannot be represented as one.
    However if you get rid of whatever it is that loads your XML file and replace it by more standard JAXP processing, you should be able to parse an InputStream that reads from the jar entry. You know how to get that so it should not be a problem.

  • Call class inside a jar file??

    Hello group,
    I have a class with a main mathod and this class is inside a .jar file. This jar file reside under my
    web-inf\lib or class-path directory in my application at Weblogic Server.
    How can I call this class by command line?
    I have to create a cliente to do it?
    Is it possible? I´m having problems because the weblogic server is using the jar file at the same time that I trying use it calling by command line.
    Where can I find more information?
    Message was edited by:
    Denimar

    Authcloud9981 wrote:
    Hi I have an executible JAR file that I can call from command line by using the command - "java -jar file.jar".
    Is there a way for me to call this JAR file inside a Java class in another Java Program?There can be more going on in a jar than just as a container for classes.
    The manifest defines the behavior. So to replicate the behavior you must do exactly that.
    As an example of that.
    [http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html#download]
    Additionally by running it in your application you must consider what the scope of that is. If you just load the classes directly then they will be in the system class loader and thus cannot be unloaded. Using a class loader solves that.

  • Can i load a class in subdirectoy  inside a jar file using applet tag?

    hi every one.. thank you for reading ... i am really in dire need for the solution..
    my problem is that i have a jar file contianing a package which inturn contains my applet class...
    i am trying to access this applet class using a applet tag in html file. this html file is in same directory as the jar file. i am having no problems in windows but when i am doing this in linux apache server i was getting class not found exception. (already checked the file permissions). and when i am successful when using simple package directory instead of jar file . so gist of my quesition is "can i load a class in subdirectoy inside a jar file using applet tag in a html file"?

    When you tested in Windows were you using Internet Explorer? On Linux you will be using a different browser, usually Mozilla of some version, or Firefox. Note that the HTML tags for applets will be different between the browsers if you are using the object tag. Principally the classid value for the object tag will differ between Firefox and Internet Explorer.

  • How can i get the path to config folder placed inside the jar file?

    Hi i have developed an RCP application using eclipse.
    In my application config directory is there.
    When i export my RCP application as JNLP Project the jar file is created which contains config folder inside it.
    When i download the application using java web start , how can i get the path to config folder placed inside the jar file?
    Will the config folder exists in local cache in my system?
    Help needed.
    -Deepak

    -- This works in CS6:
    tell application "Adobe InDesign CS6"
      set myDocument to active document
      set selectedRectangles to selection of myDocument
      set theGraphicsLink to file path of item link of (graphic 1 of (item 1 of selectedRectangles))
    --> "Macintosh HD:folder/folder/filename.tif"
    end tell

  • Running a batch file inside a jar

    HI all
    I created a jar file , in which i need to run a batch file , so i wrote a main class to execute the run the batch file , but when iam running the jar it is searching for the given batch file out side the jar.
    my code is some thing like below
         public static void main(String args[])
              try
                   Runtime rt=Runtime.getRuntime();
                   Process process=rt.exec("%DIRNAME%/start.bat");
       InputStreamReader reader =
                      new InputStreamReader ( process.getInputStream () );
                   BufferedReader buf_reader =
                       new BufferedReader (  reader );
                    String line;
                    while ((line = buf_reader.readLine ()) != null)
                                 System.out.println (line);
              catch (IOException e) {
                    System.out.println (e);
         }so please help me.. is it the problem in specifing the path...?
    are does it have any other method to read the stream functions ..
    thanks in advance
    sam

    I don't think this will work. You could not go to a command line and enter, "%DIRNAME%/start.bat" if start.bat was inside a jar - the CLI doesn't know how to read a batch file inside a jar.
    I think it would work to programmatically read the lines of start.bat (when it is inside the jar) into an array of Strings and use Runtime.exec with the array as the argument.
    It would also work to extract the start.bat file, then execute it using Runtime.exec.

  • Can I place jar files inside ejb-jar.jar?

    Hi,
    I'm reading about the packaging rules for creating an ejb-jar.jar file, and I'm wondering whether it's possible to include a jar file (containing helper classes) inside of the ejb-jar file. A "lib" dir (for containing such helper jars) doesn't seem to be part of the ejb-jar file format.
    The EJB 3 spec has this to say (Ch 20, "Enterprise JavaBeans 3.0, Final Release):
    "The ejb-jar file must also contain, either by inclusion or by reference, the class files for all the classes and interfaces that each enterprise bean class and the home interfaces, component interfaces, and/or web service endpoints depend on, except Java EE and J2SE classes. This includes their superclasses and superinterfaces, dependent classes, and the classes and interfaces used as method parameters, results, and exceptions"
    Now, it seems that the root of the the ejb-jar file contains all the classes (in the appropriate Java package layout). But what about including JAR files? The ejb-jar spec seems to have nothing to say about a "lib" dir that can contain jars (as a WAR file can).
    Summary of questions:
    1) Can an ejb-jar file contain a jar file? If so, how/where?
    2) Can the ejb-jar file's META-INF/MANIFEST.MF file contain a reference to a JAR file?
    I'm not considering correct design at the point... I'd just like to know if these 2 scenarios are possible.
    Thank you!
    kamuifx

    Yes, I have an ear file..................
    I have an EAR file; inside the EAR I have a WAR file (web module) and an EJB-jar file (EJB module).......... the EJB need some classes placed in a jar file (a helper .jar or an util .jar)...........
    my question is: How can I use the classes of the .jar files in te EJB??????
    thanks

  • Changing values in property file inside a jar in an ear

    Hi,
    I have an application that contains EJB. The environment values needed for initial context of the ejb is kept in a .properties file. I have created an ear of the application. Inside the ear there is a jar which contains the .properties file. I need to deploy the ear to different environments. However before deploying I need some kind of script to change the values in the .properties file inside the jar in the ear.
    Can anyone provide some help/pointers about how can I achieve it (Using ANT/WLST)

    WLST does not have any capability to update a JAR.
    WLS 10.3 (still in tech preview) has the ability to override properties
    files inside the jar with an external properties file. This would allow you
    to deploy the same ear to different environments, and then only deploy a
    different properties file in the plan directory.
    <Rishi Shah> wrote in message news:[email protected]..
    Hi,
    I have an application that contains EJB. The environment values needed for
    initial context of the ejb is kept in a .properties file. I have created an
    ear of the application. Inside the ear there is a jar which contains the
    .properties file. I need to deploy the ear to different environments.
    However before deploying I need some kind of script to change the values in
    the .properties file inside the jar in the ear.
    Can anyone provide some help/pointers about how can I achieve it (Using
    ANT/WLST)

  • Classpath inside a JAR file...

    Hi there,
    I have recently learned that I cannot use my JDBC driver JAR file from within another JAR file. So now I have two JAR files........my application and associated files in one and the JDBC driver in the other.
    This gives me......
    gatekeeper.jar
    ojdbc14.jar
    My problem is, when running the application I get an exception stating that it cannot load the Oracle driver. I'm assuming that this is because it cannot find the JDBC JAR file from within the manifest Class-Path.
    My manifest is this: -
    Main-Class: GateKeeper
    Class-Path: ojdbc14.jar commonfiles images
    This includes my commonfiles package (all classes) and my images directory. All these things are included. I'm trying to run the gatekeeper JAR file from the same directory as the JDBC driver JAR file.
    I've tried: -
    Class-Path: ojdbc14.jar commonfiles images
    Class-Path: .\ojdbc14.jar commonfiles images
    Class-Path: ..\ojdbc14.jar commonfiles images
    None of these things help. Obviously I could just specify the JDBC JAR file when running the application using: -
    java -cp ojdbc14.jar -jar gatekeeper.jar
    ....but I want to have the user just run it without having to know about the classpath.....i.e.
    java -jar gatekeeper.jar
    DrClap said (and I quote) "In the same directory as your main JAR file is easiest, but at any rate the Class-Path entry in your manifest should include the relative path of the driver jar."
    ...Isn't the relative path to the JAR file outside the JAR this?
    .\ojdbc14.jar
    Basically, to recap....from within my JAR application file I want to add to the classpath in the manifest file the JAR file that is outside the application JAR file in the same directory. Helpy?
    ...I'd offer dukes to you fine folks, but I've only got two left. Since I'm such a newbie, I'm not likely to get any more inthe near future, so I'm saving them for a raining day. :) I hope I can get a little charity without resorting to duke bribary. :)

    Hmmm...still not joy. This is the exception I'm getting with the stacktrace.
    C:\Java\deployment\GateKeeper\JarFile>C:\j2sdk1.4.2_03\bin\java -jar gatekeeper.jar
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:141)
    at commonfiles.OracleDataConnection.<init>(OracleDataConnection.java:26)
    at GateKeeperFrame$MainAction.actionPerformed(GateKeeperFrame.java:429)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    My gatekeeper.jar file contains the following files: -
    C:\Java\deployment\GateKeeper\JarFile>jar -tvf gatekeeper.jar
    0 Wed May 19 19:06:42 BST 2004 META-INF/
    95 Wed May 19 19:06:42 BST 2004 META-INF/MANIFEST.MF
    0 Wed May 19 19:06:38 BST 2004 commonfiles/
    1185 Mon Apr 26 22:24:30 BST 2004 commonfiles/ErrorDialog.class
    1319 Fri Apr 16 10:50:28 BST 2004 commonfiles/ErrorItem.class
    1381 Tue Apr 27 19:53:32 BST 2004 commonfiles/ErrorList.class
    4207 Mon May 17 12:58:40 BST 2004 commonfiles/FileIO.class
    1371 Fri May 14 12:00:38 BST 2004 commonfiles/Input.class
    1655 Fri Apr 23 15:13:58 BST 2004 commonfiles/OracleConnectionDetails.class
    6653 Fri May 14 14:34:58 BST 2004 commonfiles/OracleDataConnection.class
    8612 Fri May 14 15:06:02 BST 2004 commonfiles/Utility.class
    0 Mon May 17 19:56:40 BST 2004 images/
    116 Wed Apr 21 10:19:50 BST 2004 images/Connect.gif
    119 Wed Apr 21 10:19:28 BST 2004 images/Disconnect.gif
    117 Wed Apr 21 10:16:24 BST 2004 images/Exit.gif
    1024 Mon May 10 14:38:28 BST 2004 GateKeeper.class
    186 Wed May 12 11:08:44 BST 2004 GateKeeperFrame$1.class
    5300 Mon May 17 14:38:28 BST 2004 GateKeeperFrame$MainAction.class
    1740 Fri May 14 15:21:20 BST 2004 GateKeeperFrame$MainButtonListener.class
    11034 Mon May 17 11:07:30 BST 2004 GateKeeperFrame.class
    898 Wed Apr 28 22:10:56 BST 2004 LoginFrame$DataSource.class
    6938 Wed Apr 28 22:10:56 BST 2004 LoginFrame.class
    3261 Fri May 14 12:22:28 BST 2004 UsersDataModel.class
    My manifest file for gatekeeper.jar file contains this: -
    Main-Class: GateKeeper
    Class-Path: ojdbc14.jar
    And the directory where I'm running the gatekeeper.jar file contains this: -
    gatekeeper.jar
    ojdbc14.jar
    which I'm running using: -
    java -jar gatekeeper.jar
    Thanks for your help guys. And no, I don't have a newline at the end of the Class-Path entry in the manifest.

  • How to display PDF file, inside the SWF file or flash exe file

    I  have create the application for Employee details using flash actionscript 3.0
    This application is to view the organization employee details, iam using the tree component in this application,
    the tree component is to get the dada via xml file, this xml file save in the remote server ,
    I display the PDF file inside the swf file to using " StageWebView" class . Then i goto Publish Setting to change the  player Adobe Air 2.6 and run the flash file using
    ctr-l + Enter . It is work correctly the PDF file is Displayed inside the Swf Output. But I Publish this file to exe . then i run the exe it is not working .
    The application is run The xml data is onely get and displayed the Tree component then i click the tree item employee name the xml data in not display and the pdf file is not open .
    Pls Help...................

    hi i need to display the pdf file inside the swf file or flash exe file .
    I use the navigateToURL class this is open the pdf file on the browser. I want to display the pdf file in the swf window .
    Please suggest.

  • How to read some files inside the jar

    Hi,
    I have an applet that runs with JWS. The user can input some information and then I need to show this information in a web page. As the application can be run offline, I cannnot use JSP�s to generate the web page. The information is saved in a xml file, so I use a xsl parser to generate the html code. The problem is that I have to include some javascript files (.js). I put these files inside the jar, but, how can I read these files, or how can I reference these files from inside the html page ?
    Thanks !

    You can use getClass().getResource(classpath)
    to get a stream version of the data from your
    jar file. If you need to put it in a file, you
    can write that stream to a file in a temp directory.
    classpath is the classpath of your js file

Maybe you are looking for

  • How do I make my workhorse Samsung ML-1740 printer work with Yosemite 10.10.3?

    How do I make my workhorse Samsung ML-1740 printer work with Yosemite 10.10.3?

  • Not getting empty tags in XML output

    Hello, I am using DBMS_XMLQuery.getXML function and cusor function in my select statement to generate XML documents. If the column value is null, the XML document is not generating a empty tag. How do I generate empty tags? My query is :- SELECT MSG_

  • Java.lang.ExceptionInInitializerError

    I am trying to create a link to another system from an existing application developed on Oracle9i JDeveloper 9.0.2.822 using java version 1.3.1_02. This uses an API provided by the Vendor of the target system (webMethods 6.1) which uses the entrust l

  • Adobe 9.3.3 Silent Print issue

    I upgraded from Adobe Acrobat 9.3.2 to 9.3.3. Now when I launch an xfdf to populate it's PDF and pass the print parameters (only occurs when it is a silent print) it does the following: The print completes as expected but I receive the following mgs

  • Problems with IPhoto after transfer from Mobile Me

    It seems that most of the necessary transfer out of of Mobile Me was accomplished, but I am still somewhat confused where my Gallery went to and now my IPhoto program keeps telling me that it is synchronizing to my service provider (Comcast), but it