Is there any way to force jvm load a new class?

I write a standalone command line program. This program calls a function which I added to an existing class. the existing class has run run for a while by other processes.
When I run my command line program, it can not find the function I added to the existing class. But I am 100% sure I have overwrote the existing class file with my new copy. It looks like the old class file is still in effect.
How can I instruct the JVM to load my new class file, not using the old one(maybe it is cached in memory, and didn't get refreshed)
Welcome any suggestions. I have run out of idea. (BTW: It is infeasible for me to restart the computer)

Classes are loaded by an object called a ClassLoader which stores all the classes it loads in some kind of internal Map object. If you ask the same ClassLoader for a class it's already loaded it will given you the old one.
The only way to drop a class is to drop the ClassLoader which loaded it and create a new one to load a new version.
What you need to do is to put the class file in question is a directory or jar which isn't on the class path. And make sure that no class file of the same name exists on the classpath (because that will be loaded in preference).
Then you create a java.net.URLClassLoader pointing to the directory or jar (use FIle.toURL() to turn a file into a URL).
Then call loadClass on that to load your class file. Then you'll probably have to call newInstance() on the class object to create an instance.
Of course, if new method signatures are added you'll have to access them using Method objects, since they won't be know about at compile time.

Similar Messages

  • Is there any way to force the applet to load the file without using cache?

    Hi,
    I have the applet that renders some data from a file specified as the parameter. The problem is that the user can do something, that changes the input file and reloads the page, but the applet renders old data (from browser cache most probably)
    Is there any way to force the applet to load the file without using cache?
    Regards,
    Zdenek

    The initial view (IV) settings within a PDF file are static tags - they can't be made to dynamically-adapt based on the window dimensions,it's the renderer (Acrobat, Reader, or whatever else is opening the file) that decides if and how it will follow the IV requested by the file header.
    It would be possible to use a Page Open action on the first page of the file, which does some nasty math with the various doc.*WindowRect objects to work out how much "wasted" space there is, and then set the doc.layout and doc.zoomType properties - but page actions are a different concept to IV as the zoom will reset itself every time that page is viewed. Users don't like their application apparently fiddling with the zoom level without being told to!

  • Is there any way to force iPhoto to present faces by folder for identification rather than randomly?  Would provide better context for identification especially if a huge number of images is involved.

    Before I commit the time and energy required to load and tag faces in 25,000 images within iPhoto, I need some questions answered;
    Is there any way to force iPhoto to present faces by folder for tagging rather than randomly?  When so many images need tagging, over many years, the context of a folder helps with the identification. The work around is to load the images into iPhoto one folder at a time and do the tagging then.
    How do I get iPhoto to present the tagged faces by last name rather than first name? When so many faces will be identified, it is much easier to find people by surname, particularly when I share the library within the family. The work around is to enter names as last name and first name.  Being able to toggle the sort is much more desireable.
    Is there a way to export a portion of the library including faces?  I want to pass on portions of this huge 125 GB library to my family members.
    Since my family members will need an Apple computer to view the images and faces, they will likely have their own photo library.  So is there any way to combine two libraries and merge the faces?
    About 2/3 of my images have been scanned, so the date of creation is the scanned date rather than the date the photo was taken.  Will this mess up any sequencing or the retrieval of faces?

    If I want to carve off part of a library, I presume the way to do this is to make a copy of the library using PLM then go into iPhoto and delete what I don't want.  The result is the carved off portion.
    You don't need Library Manager to delete the portion you don't want.
    As a general rule: when deleting photos do them in batches of about 100 at a time. iPhoto can baulk at trashing large numbers at one go.
    If I want to merge two libraries, PLM implies that it will do this but will the Faces be merged too?
    I believe so.

  • Is there any way to force time machine to keep retrying after disk i/o error?

    a little background to my problem:
    i've had a hard drive problem previously, and i managed get all the data off of my mac by trying and retrying to access the same files and also from my working time machine backup. after zeroing out and reformatting my drive and doing a clean install of Mavericks i had everything back up running no problems.
    recently, my macbook pro would be stuck and slow in recently imported iphoto pics so i figured my hard drive is really failing this time around
    i try to get a time machine backup to save what i can, but after a couple of tries time machine would just stop backing up and in console i would see a disk i/o error.
    is there any way to force time machine to keep trying to backup through the disk i/o error so i can save what i can before getting a new drive?
    edit: a little more info, i know i have a harddrive error from looking at the console, but when i do a verify disk in disk utility it comes up clean and even after doing a disk repair it comes up clean i still see disk i/o errors in the console.

    See:
    *http://kb.mozillazine.org/Preferences_not_saved
    Thee can also be a problem with the file(s) that store the extensions registry.
    Delete the files extensions.* (extensions.sqlite, extensions.rdf, extensions.cache, extensions.ini) and compatibility.ini in the Firefox [[Profiles|profile folder]] to reset the extensions registry.<br />
    New files will be created when required.
    See "Corrupt extension files":
    * http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    If you see disabled, not compatible, extensions in "Tools > Add-ons > Extensions" then click the Tools button at the left side of the Search Bar (or click the "Find Updates" button in older Firefox versions) to do a compatibility check or see if there is an update.

  • Is there any way to force purchase an unsupported app?

    I'm currently stuck on OS X 1.7.5 since my MacBook Pro isn't compatible with anything more recent than that.
    However, I'll be upgrading to a new Retina MacBook Pro very soon and I'd like to purchase an OS X app that requires 10.8, since it's currently heavily discounted.
    Is there any way to force purchase it on my 10.7.5 system so that I'll be able to use it when I upgrade to a new Mac?
    Thanks!

    No.
    GB

  • I just bought a new Macbook Pro and loaded all my info from My old Macbook...now i can't remember for the life of me my Admin Password 9which i created 3 years ago)...is there ANY WAY to bypass this on my new Macbook Pro and begin again...?

    i just bought a new Macbook Pro and loaded all my info from My old Macbook...now i can't remember for the life of me my Admin Password (which i created 3 years ago)...is there ANY WAY to bypass this on my new Macbook Pro and begin again...?

    I assume that you don't have the installation discs, so:
    1. Reboot
    2. Hold command + s key down after you hear the chime.
    3. When you get a text prompt enter in these terminal commands to create a brand new admin account (hitting return after each line):
    (Type these commands very carefully)
    mount -uw /
    rm /var/db/.AppleSetupDone
    shutdown -h now
    4. You will go through the setup process again, create a new admin account, login to it and then change your existing account password or whatever else you need to do. You can delete the account you made in this process, or not.

  • Is there any way to force Sun C++ Preprocessor preserve whitespace?

    Hello!
    I'm preprocessing simple source file:
    void test()
        int i;
    }with command: CC -E test.cpp
    and CC preprocessor eats all whitespace at the beginning of each line, like this:
    void test()
    int i;
    }Is there any way to force CC preprocessor preserve whitespace?

    You cannot use the C preprocessor on C++ code, for at least two major reasons.
    1. The default -I options in CC are not the same as for cc. Try adding
    #include <iostream>
    #include <cstdlib>
    to your example.
    Even if you add the missing -I options, the conventions for finding the C++ standard headers are not known to the C preprocessor.
    Example:
    % cc -P -I/opt/SUNWspro/prod/include/CC/Cstd -I/opt/SUNWspro/prod/include/CC -I/opt/SUNWspro/prod/include/cc z.c
    "z.c", line 2: cannot find include file: <cstdlib>
    cc: acomp failed for z.c2. The predefined macros (-D options and predefined macros built into the compilers) are different for cc and CC.
    In particular, the C compiler predefines macros saying it is a C compiler. The C++ compiler predefines macros saying it is a C++ compiler. Code that is conditionalized on whether it is compiled by the C or C++ compiler will give different results. If you add -D options for C++ macros, the results will depend on the way the tests are coded. That is, testing for a C compiler or a C++ compiler will not give mutually exclusive answers, as they would if you use the correct compiler. The Solaris headers have conditional code for C and C++.

  • IS THERE ANY WAY TO FORCE KEY COMMIT

    Hi:
    Is there any way in forcing when inserting/updating a record in a block to call KEYCOMMIT. For Example, if the user inserted/updated a record and before saving the user may quit the form. I would like to enforce the keycommit trigger to be called when the form is opted to close.

    Hello,
    Try the following in Key-Exit trigger:
    BEGIN
    IF :system.form_status = 'CHANGED' THEN
    DO_KEY('COMMIT_FORM');
    ELSE
    EXIT_FORM(NO_VALIDATE);
    END IF;
    END;
    Regards,
    George
    Hi:
    Is there any way in forcing when inserting/updating a record in a block to call KEYCOMMIT. For Example, if the user inserted/updated a record and before saving the user may quit the form. I would like to enforce the keycommit trigger to be called when the form is opted to close.

  • On a large monitor, the bookmarks toolbar is opening outside of the Firefox window itself - is there any way to force it to stay inside?

    Recently I installed Windows 7 on my computer, along with a device called a Triplehead2Go, which spoofs the operating system into thinking that the computer has one monitor attached (when it really has three). When the Firefox window is relatively small on the desktop and with excess space to the right, the bookmarks toolbar opens to the right (and extends outside of the window). This creates a problem for me, as the monitor bezels get in the way of navigation. When the Firefox window is all the way to the right of the desktop, the bookmarks toolbar opens inside of the window (as there is not enough space to the right for it).
    Is there any way to force this menu to stay within its boundaries?

    The screen dimensions are "right," but I don't want it to use up any more space on-screen than is in the window.

  • Is there any way to resize already loaded preview when widget is resize?

    Is there any way to resize already loaded previews when panel widget is resize? <br />Actually, I have already a lot of preview images loaded on my preview panel's widget. when my preview panel is resize, is there any way to resize already loaded preview images without creating new preview images. <br /><br />ErrorCode CMPSImageListDataView::CreatePreview( const IDFile& previewFile, uint32 width, uint32 height, uint8 backGrey ) <br />{ <br />InterfacePtr<IPMStream> fileStream( StreamUtil::CreateFileStreamRead(previewFile) ); <br />if(!fileStream ) return kFailure; <br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID()); <br />if(!serviceRegistry) return kFailure; <br /><br />int numHandlers = serviceRegistry->GetServiceProviderCount(kImportProviderService); <br />for (int i = 0; i < numHandlers; i++) { InterfacePtr<IK2ServiceProvider> provider( serviceRegistry->QueryNthServiceProvider(kImportProviderService, i)); <br />InterfacePtr<IImportProvider> importProvider(provider, IID_IIMPORTPROVIDER); <br /><br />if (importProvider && importProvider->CanImportThisStream(fileStream) == IImportProvider::kFullImport) <br />{ <br />InterfacePtr<IImportPreview> preview(importProvider, IID_IIMPORTPREVIEW); <br />if(preview) <br />{ <br />bool16 reallocateNeeded = kTrue; <br />if( (this->m_fCachedImHeight == height) && (this->m_fCachedImWidth == width)) <br />reallocateNeeded = kFalse; <br /><br />if(reallocateNeeded) <br />{ <br />this->DeleteBuffers(); <br />m_fpCurAGMImage = new AGMImageRecord; <br />memset (m_fpCurAGMImage, 0, sizeof(AGMImageRecord)); <br />m_fpCurAGMImage->bounds.xMin = 0; <br />m_fpCurAGMImage->bounds.yMin = 0; <br />m_fpCurAGMImage->bounds.xMax = width; <br />m_fpCurAGMImage->bounds.yMax = height; <br />m_fpCurAGMImage->byteWidth = 3*width; <br />m_fpCurAGMImage->colorSpace = kAGMCsRGB; <br />m_fpCurAGMImage->bitsPerPixel = 24; <br />m_fpCurAGMImage->decodeArray = 0; <br />m_fpCurAGMImage->colorTab.numColors = 0; <br />m_fpCurAGMImage->colorTab.theColors = nil; <br /><br />this->m_fDataBuffer = new uint8[((m_fpCurAGMImage->byteWidth) * height)]; <br />ASSERT(this->m_fDataBuffer); <br />m_fpCurAGMImage->baseAddr = static_cast<void *>(this->m_fDataBuffer); <br /><br />this->m_fCachedImHeight = height; <br />this->m_fCachedImWidth = width; <br />} <br /><br />::memset(m_fpCurAGMImage->baseAddr, backGrey, (m_fpCurAGMImage->byteWidth) * height); <br /><br />if (m_fpCurAGMImage->baseAddr) <br />{ <br />AcquireWaitCursor busyCursor; <br />preview->Create24bitRGBPreview( (uint8*)m_fpCurAGMImage->baseAddr, width, height, fileStream, kTrue ); <br />m_fCurImageSysFile = previewFile; <br /><br />return kSuccess; <br />} <br />} <br />} <br />fileStream->Seek(0,kSeekFromStart); <br />} <br />return kFailure; <br />}

    Really Thanks!! T Schneider<br />How can I do that matrix?<br />Would you mind....?<br /><br />                    <br />PMReal imageWidth = ( m_fpCurAGMImage->bounds.xMax - m_fpCurAGMImage->bounds.xMin);<br />                    <br />PMReal imageHeight = ( m_fpCurAGMImage->bounds.yMax - m_fpCurAGMImage->bounds.yMin);<br />                    <br />PMReal xOffset = frame.GetHCenter() - imageWidth/2;<br />PMReal yOffset = frame.GetVCenter() - imageHeight/2;<br /><br />gPort->translate(xOffset, yOffset);<br />               <br />InterfacePtr<ITransform> iTransform(this, IID_ITRANSFORM);<br />PMMatrix theMatrix = iTransform->GetInnerToParentMatrix();<br /><br />.??????????????????????????????.<br /><br />ASSERT(m_fpCurAGMImage);<br />gPort->image(m_fpCurAGMImage, theMatrix, 0);

  • Disc in drive that Mini will not recognize, will not eject. Is there any way to force eject?  The computer says it's empty, but it's not.

    I have a disc in the super drive but cannot eject it because the Mini does not recognize that it's there. I've tried the eject button on top of the screen and in the dvd player controls. I wish there was an eject button on the machine. Is there any way to force eject?
    Thanks.

    RGA,
    Unfortunately, I do not believe that it is possible for a DAQ board to generate an AI Start Trigger from an analog trigger, but not be triggered itself until it receives a digital trigger.
    Spencer S.

  • Is there any way to force Firefox to remember passwords?

    As many have complained about, there is a growing trend for websites to prevent browsers, including Firefox, from remembering passwords. This is absolutely infuriating. Like most people, I have on the order of 100 passwords, and thanks to idiotic, overzealous IT guys who need to justify their own jobs, we are forced to constantly change them to ludicrous, impossible-to-remember combinations of symbols and numbers. (Does anybody really get their accounts stolen because some hacker sits down and tries to guess their password? Somehow I find that very, very hard to believe.)
    First world problems, I know. My question though is simple: is there any way to force Firefox to remember passwords? Perhaps an add-on or external program of some kind? I know there are password manager programs, but the last time I checked, those were all but worthless and didn't work as well as the built-in Firefox support for remembering passwords. Thanks for any help.

    hello andrew, yes you can either [https://addons.mozilla.org/firefox/addon/remember-passwords/ install an addon] or [https://www.squarefree.com/bookmarklets/forms.html#remember_password use a bookmarklet] to circumvent this restriction.
    in an upcoming version of firefox, this functionality will also be built-in directly into the browser: http://www.ghacks.net/2013/12/24/firefox-29-save-fill-autocompleteoff-passwords/

  • Is there any way to get rid of the new control panel?

    Is there any way to get rid of the new control panel?  I hate it.  It pops up constantly when I scroll on Facebook or Pinterest, and my 3 year old turns things on and off frequently by accident.

    Check: Settings - Control Center - Access on lock Screen = Off. Access within Apps = Off

  • Is there any way to fill long loading gap between splash screen and application home page?

    Recently I have developed my first MAF app. This app is with basic design with some page re-directions, no web services/java script is used but when I start app first time then there is a long white gap after splash screen till loading application home page. Is there any way to eliminate this gap?

    User, tell us your jdev version, please!
    Check the hints given in this thread Increase Adf Application Load Time
    When a page loads all iterators are executed whihc can take some time if you have many of them on the page retrieving many rows. So what is on your home page?
    Timo

  • Is there any way to force the following initial view...

    ..."fit to page" + "two pages per screen - but only if there's room for two"?
    In other words, I want the page to fit in the screen upon initial view, but I also see a lot of wasted real estate all around that could, most of the time, fit a second page. However, I don't want the two pages to count against the "fit" -- meaning, on narrower screens, the priority should go to fitting the first page (and not showing the 2nd) rather than fit both pages at all costs.
    Is there any way to ask Acrobat to do this?

    The initial view (IV) settings within a PDF file are static tags - they can't be made to dynamically-adapt based on the window dimensions,it's the renderer (Acrobat, Reader, or whatever else is opening the file) that decides if and how it will follow the IV requested by the file header.
    It would be possible to use a Page Open action on the first page of the file, which does some nasty math with the various doc.*WindowRect objects to work out how much "wasted" space there is, and then set the doc.layout and doc.zoomType properties - but page actions are a different concept to IV as the zoom will reset itself every time that page is viewed. Users don't like their application apparently fiddling with the zoom level without being told to!

Maybe you are looking for

  • HT1296 I just got a new pc and want to sync my music from my iPhone. Help!?

    I just got a new pc and want to sync my music from my iPhone. Help!?

  • Dashboard Links At the top of Screen visibility

    Hi, When I enter as a Presentation Catalog Administrator to Answers, I can not see the some dashboard links at the top of screen. But I have access right to enter them. Is there any configuration about the visibility of the links of dashboards at the

  • Remove zeros from a channel

    Hi Diadem experts! I am trying to concote a script that basically does exactly what the ChnNovHandle function does. ChnNovHandle removes NoValue numbers from a channel, optionally with multiple channels. I want to use this function, except that I hav

  • Page restriction in adobe design from sap

    Hi, Iam designing my adobe form from SAP-ABAP transaction SFP. In my form i have two pages Page1 and page2. I want to restrict the printing of these pages conditionally means. based on my requirement, i want to print either page1 or page2 or some tim

  • Calendar Day Link

    I've created a link on calendar days that goes to another page in the application with a form. This form has a date field, and I'd like the date field to be populated with the date that was selected from the calendar page that activated the link. For