There are afunction like Runtime.load(filename.so)  but load a .class file?

I need build something like a plugin system: I get a string like "framework.plugin.FooClass" and "FooClass.class" file in run time, and I need to get a new instance of this one.
In code:
IPlugin plugin;
String className = "framework.plugin.FooClass";
plugin = (framework.IPlugin)Class.forName("framework.plugin.FooClass").newInstance();But I haven't this class in classpath. I see Runtime.load(filename.so) but look like only load native code, it doesn't? I'm on wrong way?
Thanks in advance,
Diego

Either put the plug-in's folder on the class path or use an URLClassLoader.

Similar Messages

  • J2me can load a .class file (using classLoader)?

    Hi everybody,
    I am developing a J2ME application that can load a .class file on a PDA.
    Recently, I have found that the java.lang.CLASSLOADER is not defined on the J2ME. So, there is no way to use it.
    I am asking if there is any way to load a .class file from another one on a PDA or mobile phone.
    Thanks for your time and interest,

    Use the class Class, that have a forName() method.

  • There are sites like Amazon, Facebook and pages where I need to put info on that don't totally show all the points. How can I get them to show up? I usually have to guess

    There are sites like Amazon, Facebook and pages where I need to put info like name, address, etc, that don't show where 'next' or 'skip' or 'continue' are. There is just alot of space. When I move my cursor around I have to guess if it's the right one and click

    For some ways around this see [http://kb.mozillazine.org/User_name_and_password_not_remembered User name and password not remembered - MozillaZine Knowledge Base]
    Another option is the [https://addons.mozilla.org/en-US/firefox/addon/60265/ Saved Password Editor] add-oin which allows you to add passwords for sites that disable password saving.

  • After restoring my iphone 4,it went o and i haveto restore it again,but this time,there are errors like,error 21.which i have trie fixing several times.what do i do,its so frustrating.

    after restoring my iphone 4,it went o and i haveto restore it again,but this time,there are errors like,error 21.which i have trie fixing several times.what do i do,its so frustrating.

    Hi ..
    Help for error 21 >  Resolve iOS update and restore errors

  • [svn] 3519: Fix typo in error string for situations where there are advanced messaging configuration settings from LCDS used in the configuration files but no AdvancedMessagingSupport service .

    Revision: 3519
    Author: [email protected]
    Date: 2008-10-08 04:17:40 -0700 (Wed, 08 Oct 2008)
    Log Message:
    Fix typo in error string for situations where there are advanced messaging configuration settings from LCDS used in the configuration files but no AdvancedMessagingSupport service. The error string said that there was no flex.messaging.services.AdvancedMessagingService registered but it is the flex.messaging.services.AdvancedMessagingSupport service that needs to be registered.
    Add configuration test that starts the server with a destination that has the reliable property set which is an advanced messaging feature but there is no AdvancedMessagingSupport service registered.
    Modified Paths:
    blazeds/trunk/modules/common/src/flex/messaging/errors.properties
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/error.txt
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/services-config.xml

    Hi,
    Unfortunately I already tried all kinds of re-installs (the full list is in my original message). The only one remaining is the reinstall of Windows 8 itself, which I would really like to avoid.
    What I find really strange is the time it takes for the above error message to appear. It's like one hour or even more (never measured exactly, I left the computer running).
    What kind of a timeout is that? I would expect that, if ports are really used by some other application, I get the message in less than a minute (seconds, actually). To me this looks like the emulator itself for some reason believes there's a problem with
    some port while in reality there isn't.
    I'll eventually contact Microsoft Support, thanks for the suggestion.

  • What are different ways to load a class

    what are different ways to load a class??

    manoj.java wrote:
    I am preparing for something and exploring the java.
    want to know in regard of the same.
    Please help me out.And this means essentially nothing.
    Essentially there is only one way. Through a ClassLoader, and it's loadClass method. Now, there are multiple ways of invoking this, however, either directly or indirectly.
    Edit: There is, of course, other things, such as defineClass in ClassLoader, that lets you manually read a class defintion from somewhere, anywhere, and define, which, logically, also "loads" it.
    Now, once again, What are you trying to do? "something" and "exploring the java" are meaningless in this form. If you tell us what, exactly you are trying to do, we could actually help you do it!

  • I am sending a single-page poster in Illustrator to a commercial printer. There are several placed graphics and I want to choose the correct file-type to keep my Illustrator file nice and small.

    I am sending a single-page poster in Illustrator to a commercial printer. There are several placed graphics and I want to choose the correct file-type to keep my Illustrator file nice and small.

    Printers like PDFs, but you should consult with the print vendor before you save the file in any particular format.  Each vendor is different and have an established workflow.  They may not accept JPGs.  If the poster prints offset, you will need to supply the appropriate resolution per their request or what they require. If the poster is large format or grand format, then they will or should know what resolution is appropriate.  However, large format inkjet only requires 144-150ppi at 100% final size.  Try to get in the habit of consulting with the print vendor early on so you end up supplying what is needed.

  • When I connect my ipad to the computer and click import photos and videos, the computer says that there are no photos or videos on the ipad it says the file is empty I can't even add anything to the file!!!!!

    When I connect my ipad to the computer and click import photos and videos, the computer says that there are no photos or videos on the ipad it says the file is empty I can't even add anything to the file!!!!!

    It looks like the card may be the problem, and your best bet is to try the Card Reader - this will make the card accessible by the Finder and you may be able to drag the pics off to the desktop or, at worst, try recover the pics with an app like MediaRecover
    Regards
    TD

  • Can you use home share where there are 2 itunes on the same computer but under different user profiles?

    Can you use 'Home Share' where there are 2 itunes on the same computer, but under different user profiles?

    check out method one from this support article -> How to use multiple iPods, iPads, or iPhones with one computer

  • HT4436 Why don't all my contacts and calendar events on my iMac (version 10.7.4) stream onto iCloud? For instance, there are 470 entries in my address book but only 270 on iCloud. And not all my appointments in iCal are transferred.

    Why don't all my contacts and calendar events on my iMac (version 10.7.4) stream onto iCloud? For instance, there are 470 entries in my address book but only 270 on iCloud. And not all my appointments in iCal are transferred either.
    I have the same problem transfering Address book on iMac to contacts on iPhone (old version 3G - on iCloud). this is a hard wired connection

    Might you have 200 entries in On My Mac groups and some of your appointments in On My Mac calendars?

  • Hej. My Mac air says that there are 687mb  of photos in use. But i have deletet all my pics and i have no photos on my mac.

    Hej. My Mac air says that there are 687mb  of photos in use. But i have no photos on my mac.

    If you have some applications, it could easily be clipart that was included. Even MS Office has folders of clipart. 687 MB isn't all that much these days, if you have a few apps that include some.

  • How to load a .class file dynamically?

    Hello World ;)
    Does anyone know, how I can create an object of a class, that was compiled during the runtime?
    The facts:
    - The user puts a grammar in. Saved to file. ANTLR generates Scanner and Parser (Java Code .java)
    - I compile these file, so XYScanner.class and XYParser.class are available.
    - Now I want to create an object of XYScanner (the classnames are not fixed, but I know the filename). I tried to call the constructor of XYScanner (using reflection) but nothing works and now I am really despaired!
    Isn't there any way to instantiate the class in a way like
    Class c = Class.forName("/home/mark/XYScanner");
    c scan = new c("input.txt");
    The normal call would be:
    XYLexer lex = new XYLexer(new ANTLRFileStream("input.txt"));The problem using reflection is now that the parameter is a ANTLRFileStream, not only an Integer, as in this example shown:
    Class cls = Class.forName("method2");
    Class partypes[] = new Class[2];
    partypes[0] = Integer.TYPE;
    partypes[1] = Integer.TYPE;
    Method meth = cls.getMethod("add", partypes);
    method2 methobj = new method2();
    Object arglist[] = new Object[2];
    arglist[0] = new Integer(37);
    arglist[1] = new Integer(47);
    Object retobj = meth.invoke(methobj, arglist);
    Integer retval = (Integer)retobj;
    System.out.println(retval.intValue());Has anyone an idea? Thanks for each comment in advance!!!

    Dump all of your class files into a directory.
    Use the File class to list all files and iterateover
    the files.NastyNot really, when you are dynamically creating code, I would expect the output to be centralized, not spread out all over the place.
    >
    Use a URLClassloader to load the URL that isobtained
    for each file with file.toURI().toURL()(file.toURL()
    is depricated in 1.6)Wrong, the URL you give it must be that of the
    directory, not the class file.No, I did this quite recently, you can give it a specific class file to load.
    >
    Load all of the classes in this directory, thatway
    any anonymous classes are loaded as well.Anonymous classes automatically loaded when the real
    one isIt can't load it if it doesn't know where the code is. Since you haven't used a URL classloader to load once class file at a time, you would never encounter this. But if you loaded a class file that had an anonymous classfile it needed, would it know where to look for it?
    >
    From this point you should be able to just get a
    class with Class.forName(name)No. Class.forName uses the classloader of the class
    it's called in, which will be the system classloader.
    It won't find classes loaded by a URLClassLoader.got me there.

  • There are no readers registered for the txt type - Issue importing txt file

    Hello guys,
    I am working on SQL developer 3.2. and Oracle database 11g. I am trying to import a txt file with only two columns and 100 rows separated with a pipe. I can import the same file if its in *.CSV or *.xls format. I right click on the table > Import table > Choose the *.txt file > and then I get a message "There are no readers registered for the txt type". Why? Where do I get the reader? I am using the same exact method and the same exact data to import using a different file format and I do not get any errors. The wizard comes up and I am ready to load. I have scoured through this forum for a solution and I could not find one. Any help is very much appreciated.
    Thank you!

    It means we don't support that file type for doing imports. It sounds like a reasonable request to [add to the Exchange|sqldeveloper.oracle.com] though.

  • On my desk top there are no pictures in my web site but there are on my lap top & others can see pictures

    I have automatic Firefox update so I think I have the newest version.

    See:
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    * You can see the permissions for the domain in the current tab in Tools > Page Info > Permissions
    * You can see all exceptions in Tools > Options > Content: Load Images > Exceptions
    * You can check the Tools > Page Info > Media tab for blocked images (scroll through all the images)
    There are also extensions (Tools > Add-ons > Extensions) that can block images.
    * [[Troubleshooting extensions and themes]]

  • Runtime loading of XML file off a ComboBox selection

    I need to load an XML file at runtime based on a ComboBox
    selection that has the XML file path as its data.
    I figured out how to load an XML file at runtime by defining
    an HTTPService
    <mx:HTTPService id="stocksXML" url="xml/StockList.xml"
    resultFormat="e4x"/>
    and setting the <mx:Application
    creationComplete="stocksXML.send();"
    But when I now try to set the HTTPService url dynamically in
    the ComboBox change event handler
    private function loadData_changeHandler(event:ListEvent):void
    stocksXML.url = event.target.selectedItem.path;
    stocksXML.send();
    no data gets retrieved and the stocksXML.lastResult is null.
    What am I missing here? Why doesn't that work?
    Thanks in advance for any pointers

    I suggest adding a resultHandler to the HTTPService and check
    the results there. Also add a faultHandler so that you will know
    what the error was.

Maybe you are looking for

  • Unable to open.File type not supported.

    Hi., I'm geting error while opening any files in my meory card & even sometimes im getting disk error.could someone help me on fix this issue. Nokia C6-00 Software Version : V 20.0.042

  • What are the different ways to upload file data to SAP? Please help

    Hi Experts,    I have to transfer huge file data (few lakhs records) to SAP business transaction. What are the different ways to do the same? I have heard of BDC and LSMW. But are there any more options? Which option is best suited for huge file data

  • I can't open community pages or activity ?

    My enter net is slowly and I can't open the apple pages .

  • Warning about drop-down html widget

    There's a widget to add a drop-down menu on iWeb pages that's available on this site: <http://allaboutiweb.com/index.php/2009/04/add-a-drop-down-menu-to-your-iweb-pag es/> It works! However, you can't change the color (pale blue) or the text style (s

  • Gnome 3.10 and Awoken icons

    As of gnome 3.10 I can't get the awoken white icons to appear. Only icons I can get to appear are the default awoken icons. Running the `awoken-icon-theme-customization-dark` script does not seem to change anything. Anyone knows how to fix this?