Dont ask why! How do I call an applet that is in a jar file that is...

Can someone tell me how I would call an applet that is inside of a jar file that is inside of a parent jar file?
example call to an Applet
<APPLET CODE="TimeApplet" ARCHIVE="time.jar" />what I want to do is something like
<APPLET CODE="TimeApplet" ARCHIVE="parent.time.jar" />
where parent is the top jar and time is the inner jar.any help or links to tutorials/articles would be most appreciated.
if you ask why I wont answer.

we are doing a signed applet and we only want the user to have to sign 1 time
and we have lots of applets to display so we dont want to have them sign for
each item.Sorry but that doesn't make much sense, niether does putting a jar file in a jar file.
Do you want the "do you trust" question only one time? If so than you only have
to sign all the jar files with the same key.
You can load a jar file from your applet but it seems that these jar files will run
in sanbox security no matter how you sign it:
http://forum.java.sun.com/thread.jspa?messageID=3582952
Asking why does make sense, I coud be asking how to climb a building without
telling my objective is to get on the 10th floor.
You would tell me how to climb the building an I'd probably do it and find out
later I could just as well have taken the elivator.

Similar Messages

  • JNI: How to use FindClass to get a class in a Jar file?

    Is it possible to use the FindClass method of the JNI environment object to get a class that is in a jar file? My sample application was working when my class files were in the local directory. Now that I have replaced the class files with a jar file containing the classes, the app no longer works. I'd appreciate tips from anyone who knows how to do this.
    -Andreas

    Is it possible to use the FindClass method of the
    JNI environment object to get a class that is in a
    jar file? My sample application was working when my
    class files were in the local directory. Now that I
    have replaced the class files with a jar file
    containing the classes, the app no longer works. I'd
    appreciate tips from anyone who knows how to do this.It has nothing to do with JNI.
    The method uses the class path just like any other class loading situation in java. The reason it worked before is because your class path included the directory. It doesn't work now because either the jar is not in the class path or there is something wrong with the class path.

  • Why can't the finder in Mountain Lion 10.8.2 find files that have successfully downloaded, or that other programs can find?

    Why can't the finder in Mountain Lion 10.8.2 find files that have successfully downloaded, or that other programs can find?
    This happens with maybe 1 out of 5 files. These are files that have either an ."aa" extention, or or are libraries that icloud can see, but finder can't.

    Files beginning with a period are invisible and library files are system files. Spotlight cannot find either unless configured to do so (btw, this is not a Finder issue but a Spotlight issue.)
    Get Spotlight to search system files (and more)
    Enter the search term in the Finder window's search field.
    Click the [+] button in the search bar to add a search option.
    In the first drop down menu choose Other.
    Choose “System Files” from the list that pops up (and check the box to place in drop down menu to avoid this step later,) click on the OK button.
    Now back in the Finder choose Include from the second drop down menu.

  • Why can't I read any of my resources in a jar file?

    For an application I was developing, I wanted to create a Binary File using the following code:
    DataInputStream in = null;
            try {
                File file = new File(name);
                in = new DataInputStream(
                        new BufferedInputStream(
                            new FileInputStream(file)));
            } catch (FileNotFoundException e) {
                System.out.println("Non-existential File.");
                System.exit(0);
    }I am using Netbeans 6.5.1., and it groups my projects so that there are folders for build, src, dist, nbproject inside the project folder. The application that I am developing is a graphics demo that requires the use of several text files to represent the maps, so I wanted to read them using a FileInputStream.
    I kept this file, "islandmap.txt", in the src folder in my project. In the method above, I coded my program so that the "name" would be "src\islandmap.txt", and it read from the file perfectly. However, I needed to compile it to a Jar file too. After doing that, the program no longer functioned. I remembered when I used a tutorial long ago that used
    URL url = getClass().getClassLoader().getResource(fileName) ... in order to get the directory of the files. That made sense, because a person who is running the program via Java Webstart or a Jar Executable would definitely not have the parts of the program located in the same directory, so the code is used to find where the java program is. However, I realized something...
    File file = new File( - constructor - )There are four constructors for files, and I only think I could use two. The first is using a string, like I have done before with "src\islandmap.txt." Now, the URL url = getClass().getClassLoader().getResource(fileName) part, it was used before to locate a URL in order to open a buffered image. The constructor for File does not support URLs, but instead supports URIs.I tried converting between the two, changing a URL into a string, and producing a URI from the string. But it did not work, giving me an error that URI was not hierarchical. And that's when I realized that they were certainly not interchangable.
    More specifically, here is my code as of now:
    public boolean loadMap(String mapName) {
            String path = "src/islandmap.txt";   //This is where the map files are stored
            mapName = getClass().getClassLoader().getResource(path).getPath(); //getPath changes the URL into a String
            DataInputStream in = null;
            try {
                File file = new File(mapName);
                in = new DataInputStream(
                        new BufferedInputStream(
                            new FileInputStream(file)));
                 //code to actually read from the file goes here
            } catch (FileNotFoundException e) {
                System.out.println("Non-existential File.");
                System.exit(0);
            } finally {
                 //close in
    }So that is my problem now. I am stuck. For my purposes, I basically must use a stored text file within my jar, but I don't know how to read it. It distresses me that normally, I already know how to open images that are located inside my src folder using URLs, but not any other file requiring a File class to be wrapped within a Buffered Writer/Reader. Could somebody please assist me with this, or suggest an alternative that would also fall under my conditions? I would appreciate it so much. Thank you.
    Edited by: celestialsalt on Dec 6, 2009 5:29 PM
    Edited by: celestialsalt on Dec 6, 2009 5:49 PM

    Start with
    URL url = getClass().getClassLoader().getResource(fileName)Then observe that URL has a [openStream()|http://java.sun.com/javase/6/docs/api/java/net/URL.html#openStream()] method that will give you an InputStream. Since you are reading text you might want to create an InputStreamReader from which you can do your reading much like you used the FileReader before when you were working with a File.
    Class also has a [getResourceAsStream()|http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)] which combines the first two steps into one. Ie use getResource() as you mentioned when you want to get a URL that some other class will use to read (eg an image) or use getResourceAsStream() when you are going to do the reading yourself.

  • How can I create a jar file that will run automatically on double click

    all the jars I created run only from the command-line.
    how can I make it run by double-click on it?

    First you will need to associate .jar files with the javaw.exe program in order to just be able to double click on the jar and run it from within a windows explorer application. Next you will need to set the main class attribute of the manifest file. My understanding is that the value of this attribute is used by the launcher to know which class to load. In other words, which is your main application class. To specify this attribute open your manifest file in a text editor. You will find this file located within the jar at META-INF/MANIFEST.MF. Then, add the line,
    "Main-Class:<relative path to the main class>" However, remember not to add the .class extension to the end of the class name.
    In Windows 2000 you can associate jar files with javaw by finding a jar file in Windows Explorer and right clicking it. This will give you a context menu which should have an Open With... option (if you are not using Windows 2000 and don't see the 'open with' menu item, try holding down the shift button while right click on the file). Select the Open With... option, then, when the dialog appears highlight javaw and select the "Always use this program to open these files" checkbox. When you hit the OK button you should have all your jar files associated with the javaw process.
    Once you've done this, you should be able to double click on your jar file and run your application.
    Regards,
    Daniel Walsh

  • How to add multiple images to a JLabel from the jar file

    I want to add multiple images in a JLabel but the icon property only allows me to add one. I thought I could use html rendering to add the images I need by using the <img> tab, but I need to use a URL that points to the image.
    How do I point to an image inside the jar file? If I can't, is there another way to show multiple images in a JLabel from the jar file?

    Thanks, it works perfectly. It's a really smart way of fixing the problem too :)
    I also found your toggle button icon classes which is something I've also had a problem with.
    Thanks.

  • How do I read the images I bundled into the jar file?

    I just wrote an applet that uses
         Toolkit tk = Toolkit.getDefaultToolkit();
         tk.getImage("blah.gif");to load a bunch of image files. The class file and gif images were bundled into a jar file to minimize the number of connections the browser has to make to the server.
    The applet works fine in appletviewer but trips a java.security.AccessControlException: access denied (java.io.FilePermission select.gif read) when run in a browser. I know you normally use Applet.getImage(URL) to load images but wont that circumvent the JAR file and make a seperate connection to the server for each image? That would defeat the purpose of using a JAR file.
    How do I access the image files I bundled into the JAR file?

    From your Applet class, write the following:
    URL imgUrl = getClass().getResource("blah.gif");
    Image img = getImage(imgUrl);The returned URL will be from the Applet class ClassLoader, which will look into the specified archive (jar) file.

  • My iphone thinks I am in the India store ... dont ask me how. how do I cancel an active itunes match subscription so that I can change the country. I am a u.s. based user who recently travled to asia

    how do I cancel an active ITunes Match account in order to change the country of my ITunes store? My phone thinks I am in the India store, even though I have always been based in U.S. I cannot update apps on Iphone until I change the store. The Iphone will not let me change my country until I cancel an active ITunes Match account? Help!

    How to Change Country with iTunes Match
    Although I am confused as to why you think you need to cancel iTunes Match. Didn't you originally subscribe on the US store? Or were you signed into the Indian store with a different Apple ID?

  • How can I call contacts from my list without the country code that is registered with that contact?

    I have all my contacts registered with a country code. When I want to make calls from my iphone, I do not want the phone to dial the country code, but only the area code. How can I make that happen?

    Your 3G backup contains your contacts already, you don't need to sync them to Outlook or anything just restore the backup file from the 3G onto the 4S and you should be good to go.
    This kb article should help:
    http://support.apple.com/kb/ht1414

  • HT1338 i asked for how i can setup mac operating system in my macbook ? note that my labtop runinig xp.

    i need help   i using windows xp  in my macbook and i want to setup mac os x v 10.7  but the macbook not responding to the cd .the machine stoped with the apple logo    what can i do please....

    mohamed1988 wrote:
    i need help   i using windows xp  in my macbook and i want to setup mac os x v 10.7  but the macbook not responding to the cd ....
    Are you saying you want to install 10.7 on your MacBook and you already have Windows XP installed in BootCamp? 10.7 doesn't come on a cd - it's a download purchased from Apple's App Store. What is on the cd? Which MacBook do you have and what Mac OS are you currently using?

  • I had to refresh my computer; LR was removed. How do I re-install and have it recognize all my files that have already been imported through LR?

    My computer's main files became corrupted and I had to "refresh" the system. It kept my files, but erased all of the programs. I had to even re-install Microsoft Word. So it erased my downloaded Lightroom as well.
    However, all of my files are still on the computer, including the file labeled "Lightroom 5 Catalog" and 2 others like it.
    My question is, how do I go about getting the program BACK onto my computer and having the program recognize that all of the pictures currently in my "Library/Pictures" folder have at one point already been imported through LR? I don't really even know what I'm talking about; I am not super techy. Maybe if I download it again it will already recognize all the files? I just want to move cautiously because I'm dealing with all the pictures of my 4 year old daughter who died last year.
    Thanks for your help!

    Hi JimHess,
    Yes, the files are still located in the same drive, the exact same place Lightroom put them (in Pictures in Library).
    When I double-click on the catalog file, it opens up multiple folders with little white "document-looking" blank pages, and when I click on those, it open a dialog box that says "How do you want to open this type of a file (.Ircat)?" with a little box below that says "Look for an app in the store".
    So I don't think my computer knows how to open them...I think I need to re-download Lightroom. I just want to make sure I'm not going to mess up the files.

  • How do I write a cluster of an array to a file that can be looked at with other applications?

    I have a cluster of array that are different data types. How do I write this to a file, so that other applications can read it, i.e. notepad etc?

    Each elements of the array has a cluster of different data. It is unbundled and separated by a comma , then converted to a string. It is indexed out to a CSV array and then written to a spreadsheet file. The spreadsheet file reads it and outputs a CSV array. This is then going into for loop to reassemble the string output to its original clustered data representation. The iterations puts the clusters back into the array at the correct indexed position.hint: the for loop is the key to manipulating the array data...this VI is like an egg to a chicken and chicken to an egg, whatever came first?
    Attachments:
    disassemble_assemble ARRAY.vi ‏20 KB

  • When using Excel "microsoft Office" I find on my desktop files that I am unable to task, move or relocate.  How can I get rid of them ? on my desktop files that I cannot trash, move

    I find files onmy desktop that I am unable to move ,trash or relocate.  How can I clear my desktop?

    Ongoing problem with Excel on Macs - it's been around since at least 2004 or earlier. For some reason some of the temporay files don't get deleted when you save.
    Re-launching Finder sometimes works, but otherwise restart.

  • How to verify existence/absence of debug information in a jar file

    Given a jar, how can I tell if it contains debug information or not? Is there a tool for this? (e.g, like the 'file' utility on linux, which outputs whether an ELF executable is stripped or not)
    Amit

    I'm not saying it's pretty... but there's a horrible quick & dirty way of checking for debug info
    Typically the debugging information is stored is special attributes in the class files, like "LineNumberTable", "LocalVariableTable" etc.
    Depending on which type of debugging setting was used to compile the source code, these will be present in the binary class file.
    So, you might unjar the contents of the jar and run eg.
    find "LineNumberTable" *.class
    to find all classes with line number information.
    I tried it on a sample class and it worked for me here.
    Hey, I know it's a hack, but not everyone has time to write a full disassembler !
    regards,
    Owen

  • How do I change my apple Id with out loosing my files that are stored on my mac

    I would like to change my apple Id.  When I tried to log out of iCloud the program warned me that all files that are stored on the cloud will be deleted from my mac.  I would just like everything to remain untouched and begin using a different apple ID

    Hi Alan,
    If you wish to use different Apple IDs for different Apple services on your Mac, you should follow the steps in this article -
    Apple ID: What to do after you change your Apple ID - Apple Support
    Thanks for using Apple Support Communities.
    Sincerely,
    Brett L 

Maybe you are looking for