How to get the jar file without knowing his name and any class on the inside?

Hello, everyone!

I would like to know if there is a way to get a reference programmatically in the original container without knowing his name and any class it contains. I mean by "initial pot" the pot that was called in the prompt, like this:
java -jar jarfile.jar
or in another way, in a graphics system. To be honest, what I really want is to get a reference to the manifest of the jar, but I know that if I can get a reference to the jar I can get a reference to its manifest file. Or if you know a way to get the manifest directly, it would also be useful. So, is there a way to do this?

Thank you.

Marcos

Ah, so you want to find the calling class and get its source code.

I managed to get the class calling on occasion, but this is probably a somewhat fragile solution. You must extend SecurityManager because getClassContext() is a protected method.

    private static class CallerFetch extends SecurityManager {

        public Class getCallerClass() {
            return getClassContext()[3];
        }
    }
    private static CallerFetch callerFetch =
            new CallerFetch();

    /**
     * Find the class of the code which called the
     * method that invokes this method.
     * @return The class of the caller's caller
     */
    public static Class getCallerClass() {
        return callerFetch.getCallerClass();
    }

Tags: Java

Similar Questions

  • How to get the parameter values of a step type custom when I create file and adding a type of step seq

    I use lv 8.5 and teststand 4.0.

    I did a step type custom and recorded at the MyTypes.ini in pallets of type.

    I specified a default module by opening the properties of the custom step of *.ini type window, then I put some values of the parameters.

    T1) when I open teststand and I add the custom step type manaully in seq file, the labview module parameter values are represented.

    But, if to use file (create and add support prototype stage), the labview module parameter values has the default value.

    Using joint file, how to get the setting custom step type values I put in *.ini?

    Q2) each type of step are automatically by name through the use of LoadTypePaletteFilesEx. When I open teststand and I add the custom step type manaully in seq file, the module is loaded automatically. Inside the attachment, I use a prototype of charge and a fixed path where the module labview is to load the labview module.

    Can I load module automatically without using a prototype of charge or how can I get a dynamic path of type step?

    I solved Q1 for myself by using the mapping tab of the parameter within the configuration to the default module window.

    Everyone knows Q2?

    Thank you.

  • Windows vista and playstation 3 - I do not know how to get my PlayStation 3 appears on my network and I don't know how to enable file sharing

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas:

    • You have problems with programs
    • Less error have a playstation 3 and windows vista. I have a combination of problems aggravated by not being not very Internet / computer savvy. The issue is around file sharing and lower my firewall. I don't know how to get my playstation 3 appears on my network and I don't know how to enable file sharing. at one point, the RAD icon appeared and without changing anything, he disappeared. I can follow the simple instructions but my absence I have a playstation 3 and windows vista. I have a combination of problems aggravated by not being not very Internet / computer savvy. The issue is around file sharing and lower my firewall. I don't know how to get my playstation 3 appears on my network and I don't know how to enable file sharing. at one point, the RAD icon appeared and without changing anything, he disappeared. I can follow simple instructions, but my lack of expertise is really crippling my ability to do for himself. I tried to lower my firewall (not sure if I did) but I need to be walked up to the baby step by baby stepof expertise is really crippling my ability to do for himself. I tried to lower my firewall (not sure if I did) but I need to be crossed self-study baby baby
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Google comes up with these:
    http://www.ehow.com/how_5074747_network-PlayStation-computer.html
    http://www.ehow.com/how_2216306_add-PlayStation-3-LAN.html
    http://www.Google.com/search?q=network+a+PlayStation+and+a+home+computer&start=10&hl=en&SA=N&RLS=com.Microsoft: en - us & prmd = ivns & to source = univ & to TBS = vid:1 & to tbo = u & ei = PrtKTanFLMmCgAfjscnVDw & to oi = video_result_group & to ct = title & to resnum = 10 & ved = 0CGoQqwQwCTgK
    http://www.absolute-PlayStation.com/PlayStation-Network/expert-PlayStation-3-hardware-accessory-help-PlayStation3-PS3-console/10631-PlayStation-3-wireless-connection-setup.html Brian Tillman [MVP-Outlook]
    --------------------------------
    https://MVP.support.Microsoft.com/profile/Brian.Tillman
    If a response may help, please vote it as useful. If a response to the problem, please mark it as an answer.

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • Hide: I went to my documents and I had this issue, and I clicked on something that is called HIDE and I don't know how to get to this file now!

    I went to my documents and I had this issue, and I clicked on something that is called HIDE and I don't know how to get to this file now! Anyone know where are the hidden files?

    Go to start / Control Panel / folder Options / view and check the box to show the hidden files and folders and uncheck to hide extensions of known file types.  Only the first is required for this problem, but the other may be useful later and you might as well do it while you're already here.

    Now, you will be able to see the folder.  It will be in the same place, it has always been (it has not been assigned) - it was just hidden and now that you can see hidden files and folders you can see again.  You may notice that it deteriorated a little bit lighter that other records - it is a sign that it is a hidden file or folder.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to get the JOINT-2 log file

    Hi, we installed in the 6500 system JOINT-2 cat. Anyone know how to get the syslog JOINT-2 file? and how config to send the log to syslog server? I know that these two questions are quite simple, but I've yet to find answers.

    Any help would be greatly appreciated.

    You can get the JOINT events to the CETS format. Using the Manager of IPS or other tool to collect these logs.

  • How to get the path of the vmdk to a VM stop file?

    Hi guys,.

    How to get the path of the vmdk to a VM stop file in ESX Server via the VIX API?

    I try to get it via the VixVM_ReadVariable() function. but it seems that this function requires that the virtual machine is power on.

    I don't want to go the virtual machine started, I just want to know if I can get the path of the vmdk file when a virtual machine is power off.

    Thanks in advance.

    Sorry, I don't have any samples.

    However, if you look at the layoutEx of the managed object VirtualMachine field, you will see that the VirtualMachineFileLayoutEx data object has a field "files" which should contain the paths of affected files.

    I hope that it should be able to help get started.

  • How to get the full path of the image open in a filter plugin file?

    Hello

    How to get the full path of the current file, including the directory, the file name with the extension. I need information to download the file on a webserver for a plugin. I found an example that can get the name of the document (title property) but without extension and directory. How can they?

    James

    There is no way to get the full path of the active document in a plug-in filter. A plugin automation has access to this information and the file format plug-ins.

  • How to get the path or the file name of getChild

    Hey everyone, good day!

    Is - anyone here know how to get the path or the file name of an object inserted into the scene?

    Here's the scenario:

    I am developing a flash application, which allows the user to insert background to the scene to help her browse and select using the FileReference in flash. I inserted some image the user successfully choose, but what I'm trying to make, is that if the user clicks on save, the background image it has chosen will be copied to a different folder on the web (file upload). So I need to know the path and the file name of the background image.

    Here is my AS3 code:

    for (var i: uint = 0; i < container.numChildren; i ++) {}
    trace ('\t|\t' + i +'. \t name:' + container.getChildAt (i) .name + "\t type:" + typeof (container.getChildAt (i)) + "\t" + container.getChildAt (i));
    }

    ------------------------------------------------------------------------------------------ -----

    Here is the message trace of the code above:

    |     0 name: instance120 type: object [object Loader]

    ------------------------------------------------------------------------------------------ --------

    Any help here? I thank in advance.

    The Loader class has a property contentLoaderInfo (an instance of the class LoaderInfo) that contains information, that you are probably after, including the url of the content that has been loaded...

    Loader.contentLoaderInfo.url

  • How to get the name of the current PDF file?

    Hello world

    I know this is maybe a question has been asked millions of times, but I couldn't find a straight answer.

    I am using a workflow that comes with a Content Manager Solution is not Adobe this WF will generate a file very long (about 30 characters) name that will be used as the number of unique processes.

    To go to the step next in the workflow that I have to update the table in the database and registration update will use the process number.  What I did is that I added a field in hidden text in the form, which should have the number of processes on the initialize function.

    Now my question is how to get the file name of the opened PDF file?

    I'm sure that there is a function in JS, but I couldn't find the way to do it.

    Thanks in advance guys for help.

    Mazen

    Acrobat can create LiveCycle Design possible forms, but each uses a different and different languages or syntax approach.

    There are a number of ways to get the file name and path, urt getFileName.

  • You will need to plug Sony IEEE 1394 camcorder to an iMac. It would connect to the thunderbolt via an adapter port? I have a cable of firewire 800 and wanting to know how to get the video of my iMac. Thanks for any help you can give :)

    I borrowed a camcorder tape Sony that has an IEEE 1394 (ilink Sony) and eager to download video from my iMac.

    It would connect to the thunderbolt via an adapter port?

    I have a cable of firewire 800 and wanting to know how to get the video from my iMac via this cable.

    Appreciate any help you can give :)

    You want a Thunderbolt Apple FireWire adapter. Here is a link (to the US store):

    http://www.Apple.com/shop/product/MD464LL/A/Apple-Thunderbolt-to-FireWire-ADAPTE r? FNODE = 8 b & fs = f % 3Dadapter % 26fh %3 D 4595% 252B45b0

    Sorry, I don't know what software you need to play your video, once you get the cable work.

  • How to get disabled login user (without password) at startup, so NOT to SHOW at all and so after the switch, go to desktop directly

    Vista Ultimate 64-bit

    How to get disabled login user (without password) at startup, so NOT to SHOW it to all (and needed clicked) and so after the switch, go to desktop directly?

    Also after inactivity, how to not go to sleep mode and press "power on" to bring back?

    Hello

    If you want to start directly on the desktop?

    How to automatically connect at startup in Vista
    http://www.Vistax64.com/tutorials/66966-logon-automatically.html

    Or

    How to make Vista require a user name and password when connecting
    http://www.Vistax64.com/tutorials/89812-logon-username-password.html

    =========================================

    Start - Control Panel - Power Options - upper left - require a password on wake up
    tick her do not require a password - save the changes.

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • How to get the battery level and status in the cpp file?

    Hi all

    BatteryInfo class so I can I know how to get the battery level and the State in .cpp class?

    Hi Benecore,

    I have Add method below,

    #include

    But I only variable BatteryInfoPrivate not get variable BatteryInfo. You can also check on your side.

    So let me know how to get batteryInfo instance?

  • How to get the mobile applications other than phonegap Build Service apk file in Dreamweaver CM³

    How to get the mobile applications other than phonegap Build Service apk file in Dreamweaver CM³

    Dreamweaver is a tool, not an install Android of web authoring tool.

  • I'm new to CC.  I discovered that I had to download first CS6 inorder to get it. (May not yet know how to get the title templates, etc. cannot understand instructions; but I spread) I see that it still says trial.  How can I get the

    I'm new to CC.  I discovered that I had to download first CS6 in@order to get it. (May not yet know how to get the title templates, etc. cannot understand instructions; but I spread) I see that it still says trial.  How can I get the full thing.  I am a Subscriber complete cc

    I don't know what you've done, but here are the instructions to install the PProCS6 and the callback with a cloud account

    Yet the instructions http://helpx.adobe.com/encore/kb/encore-cs6-installed-cc.html if you have a subscription

    - and the difference in the Cloud application manager 2015 https://forums.adobe.com/thread/1906752

    Still will not run as a trial, it is enabled when you install and activate PProCS6

Maybe you are looking for