Setting the CLASSPATH from the JVM by a class

Hy experts
I have an application thats searching a jar file and have to access classes from this jar file.
There are two ways to do this:
1.
Loading the jar file byte by byte and create the classes to load them into memory. This is the hard way.
2.
Setting the CLASSPATH variable in the running program! Thats the easy way! May how does it works?
Is there any possiblity to set the classpath in a running application or only in the shell?
Thanks for help
konrad

the classpath is readin when you run the JVM ie issue the 'java' command, the environment cant be altered to update a new classpath. However, why not just put the files you wish to load at runtime within the current classpath you've setup. If you use the System.loadLibrary(), you should be able to pick up the classes you wish to readin at run time via this approach.
good luck
rob

Similar Messages

  • Setting classpath from the command prompt

    each time i try to set the classpath from the command prompt it is not always well done . can someone give a good format
    i.e set classpath = ;c:\document and settings\ luke

    each time i try to set the classpath from the command
    prompt it is not always well done . can someone give
    a good format
    i.e set classpath = ;c:\document and settings\ lukeThe best way is not doing it at all.
    Anyway, try:
    set classpath = ".;c:\document and settings\luke"

  • Setting the classpath of the JVM for OC4J

    Is there any way to add a path to the classpath when the embedded OC4J is run? Although the OC4J is finding my classes, the Oracle JDBC driver isn't. Here's a bit more info:
    I've been having a bit of a problem getting database java objects ("CREATE TYPE...EXTERNAL NAME...LANGUAGE JAVA USING SQLData") instantiated on the client.
    - I have an object table of type t_my_type with Java class "mypackage.MyType".
    Code sample:
    ResultSet rs = myStatement.executeQuery(
    "SELECT VALUE(p) FROM my_type_table p" );
    rs.next();
    rs.getObject( 1 );
    Exception in thread "main" java.sql.SQLException:
    Inconsistent java and sql object types:
    ClassNotFoundException: mypackage.MyType
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)
    at
    oracle.sql.JAVA_STRUCT.toJdbc(JAVA_STRUCT.java:108)
    ... ad nauseum
    And yet when I add "-classpath /path/to/mypackage" it works fine. HOWEVER, I don't know how to add it to the OC4J startup classpath (marked "HERE" below? -- not application.xml, the one that you see in the "Log" window in jDeveloper):
    java \
    -server \
    -Xdebug \
    -classpath /path/to/oc4j/oc4j.jar:<HERE> \
    Incidentally, I'm also interested in having the Database send me the bytecode for the class ITSELF instead of having to also have a copy of the .class/.jar on the client side as well.
    Any help would be appreciated. Thanks.

    The simplest way to do this is to copy classes12.zip to the WEB-INF/lib directory. The JSP should then find this automatically.
    As a side note, that is an ancient JDBC driver - you might want to upgrade to something from this millennium.

  • I have an old itunes act with a lot of songs that i set up before i owned an iphone. now that i have an iphone i have a new act. my question is how do i get the songs from the old act onto my new iphone?

    I have an old itunes act with a lot of songs that i set up before i owned an iphone. now that i have an iphone i have a new act. my question is how do i get the songs from the old act onto my new iphone?

    Hello brjdunn,
    Thanks for using Apple Support Communities.
    You are able to change your Apple ID by following the instructions below.  That way you will still have access to all of your previous purchases:
    Change your Apple ID
    http://support.apple.com/kb/HT5621
    Take care,
    Alex H.

  • I have the djay app on my ipad and i want to record the set i'm playing on my iphone through garageband. i need to take the sound from the headphone jack of the ipad, as the 30pin connector will be used to connect to the DJLive accessory. Is this possibl?

    i have the djay app on my ipad and i want to record the set i'm playing on my iphone through garageband. i need to take the sound from the headphone jack of the ipad, as the 30pin connector will be used to connect to the DJLive accessory. Is this possibl?reco

    You may get a better response in this community:
    https://discussions.apple.com/community/app_store/garageband_for_ios

  • HT3349 How do you select a sub-set of cells from the entire document so you can print only those specific cells?

    How do you select a sub-set of cells from the entire document so you can print only those specific cells?

    There is no analog to MS Excels print range.  So the next best thing is to plan your data so that you don't need to use print range.  The next best thing after that is to select the range of cells you want to print, then copy, the switch to the application Preview, and create a new document from the clipboard (select the menu item "File > New from Clibboard") then select all, copy then paste to the destination (maybe an email) .
    You can also paste that portion of the table into another table (or a new table) by pasting values only

  • TS4006 how to set a tracking from the computer if someone stolen the ipod

    how to set a tracking from the computer if someone stolen the ipod

    Welcome to the Apple Community.
    You can only locate your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
    Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely.

  • I have my camera (Canon 5D MARK 2) set to take both JPEG Large and Raw files with each shot. I uploaded the images from the card to my Pro (Aperture 3) and while the import info said 1500 images were uploaded, I can't find the RAW images.  Aperture put ab

    I have my camera (Canon 5D Mark 2) set to take both JPEG Large and Raw files with each shot. I uploaded the images from the card to my Pro (Aperture 3) and while the import info said 1500 images were uploaded, I can't find the RAW images.  Aperture put about 700 images in an untitled project folder, but all the images are the JPEGs.  What am I missing?
    Thanks,
    upsjdris

    Have you checked your "Import" settings for "Raw&Jpeg" pairs in the "Import" panel?
    You can set Aperture to import raw, jpeg, or raw&jpeg.
    If you imported Raw&Jpeg, but have set Aperture to use the Jpeg as original, you will see the imported image as Jpeg image, not as a raw image, even if the raw has also been imported. You can switch between Raw and Jpeg originals for selected images from the Photos menu:
    Photos > Use Raw as original.
    Regards
    Léonie

  • I have a windows 7 dvd in the drive and the mac is set to launch from the dvd drive. How do I change the startup disk?

    I have a windows 7 dvd in the drive and the mac is set to launch from the dvd drive. How do I change the startup disk?

    Hold the option key at startup and when you get to the boot panel select your Mac OS drive.

  • Each time I open my Firefox browser, the tab from the last time opens. I have the browser set to open on my home page, not to the tab from the last time. I keep trying to save the setting for the browser to open on my home page but it doesn't.

    Each time I open my Firefox browser, the tab from the last time opens. I have the browser set to open on my home page, not to the tab from the last time. I keep trying to save the setting for the browser to open on my home page but it doesn't.

    Try to create a new profile as a test to check if your current profile is causing the problems.
    See "Basic Troubleshooting: Make a new profile":
    *https://support.mozilla.org/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
    If the new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    You can also do a check for a rootkit infection with TDSSKiller.
    *http://support.kaspersky.com/viruses/solutions?qid=208280684
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • HT5622 When my daughter got her first iphone we set it up with my email address, she now has her own email & new iphone.  I want to use my email address for my icloud, can I delete the content  from the icloud account and continue to use my email?

    When my daughter got her first iphone we set it up with my email address, she now has her own email & new iphone.  I want to use my email address for my icloud, can I delete the content from the icloud account and continue to use my email?

    Yes, but be sure she is on a separate iCloud account with a separate ID before deleting anything.  Be sure there is nothing that you want to keep on your device too.  When you delete the data from iCloud it will be deleted from all devices signed into the account.  Then you can delete the data from the existing account by doing the following:
    To delete the contacts, go to iCloud.com from your computer, log into your iCloud account and open Contacts, click on All Contacts on the left, to the right click on any single contact to select it, click on the Actions (gear shaped) icon at the bottom left and choose Select All, then press the Delete key on your keyboard.
    For Calendars, open the calendar on icloud.com, click Edit on the bottom left, then tap the minus sign to the right of each calendar to delete it.
    For Notes, open notes on icloud.com, click on each note on the left, then click Delete at the top to delete it.
    For Reminders, open reminders on icloud.com, click on each reminder and press your Delete key to delete it.
    For Mail, open your mail on icloud.com, click each folder on the left (such as your inbox), click on a single message to the right, press Control-A on your keyboard to select them all, then press your Delete key.  Repeat this for each of your mail folders except Trash.  When finished, click on the actions (gear-shaped) icon on the bottom left and select Empty Trash.
    If you also want to delete your iCloud backups you can go to Settings>iCloud>Storage & Backup>Manage Storage on your device, tap the name of your device under Backups, then tap Delete Backup.

  • If I let the guy from the apple store set up my iPad on their store computer will it still synch with my home computer

    If let the guy from the apple store set my iPad on thei computer in the store
    Will the iPad still synch with my home computer

    You will be ok if you do this. When you get home with the iPad - do not sync until you transfer purchases if you download apps and music on the iPad before you get home and sync to your computer.
    Launch iTunes on your computer and go the menu at the top - iTunes>Preferences>Devices> and check the box at the bottom of the window that says Prevent iPods, iPhones, iPads from syncing automatically. Then quit iTunes.
    Connect your iPad to your computer and launch iTunes if it does not open on its own. Right click on the iPad name or music that you downloaded into your iTunes library. While you are still in iTunes you can then select the music, photos or whatever other content that you want to put on the iPad in all of the different tabs in the iTunes window at the top. Make sure you check the appropriate headings in the various tabs - such as "Sync Music" - then select the playlists or albums that you want to sync and then you can sync.

  • HT4859 If I got a new iPhone and backed up the data from the old one, it should show up once the new one is set up right? Does an "incomplete" status mean it did not back up and can not be restored to the new iPhone?

    If I got a new iPhone and backed up the date from the old one, it should show up once the new one is set up right?
    And does an "incomplete" status on iCloud mean it can't be restored to the new iPhone?
    Help please

    What I mean is still track my stolen one. I don't know if this will make sense to you but I'm thinking that if I restore the back up data on this phone..on my stolen phone it will like forget the icloud account or something and think this phone is the stolen one so when I go to track the stolen one, it will show that phone as the one I have now because I restored the back up from that phone.

  • Can I set up a new window to open without all the tabs from the current window opwning?

    I have a new computer at work with what must be a new version of firefox. I use multiple windows to do my job. When I open a new window, all the tabs from the current window open in the new one. I am wondering how to configure a new window to open with either a blank page or just my homepage?

    I restarted Firefox and changed the homepage settings a to a different choice and back to the desired page then restarted Firefox again. This eliminated all the initial tabs from opening from opening in the new window. I am not sure how all the pages were cached or what I should have done but I no longer have this issue.

  • Does coherence cache the value from the cache?

    Hi, I have the question about if the coherence caches the value from the cache? I believe it does from my test, just want to get the confirmation.
    I like to use an example to describe my question. For example:
    If (key1, value1) are in the cache1, (value1 is an object),
    for the first time, if cache1.get(key1), coherence will deserialize value1 and return. But if in the same JVM, when cache1.get(key1) is invoked again, coherence will return value1, which I believe is cached by coherence in the current JVM, and return; instead of deserializing and return it. Is that right?
    I am asking this question because I found a problem in our project when use coherence. As the above example, if I use value1 = cache1.get(key1), and in our project, value1 object has a set method to change one of its internal attributes, and this method was indeed invoked after value1 get from cache1. Then in another class, value2 = cache1.get(key1) is called again, and I found out that value2's attribute will have the modified value, even cache1.put(key1, value1) is never invoked in the first place.
    Of course, this kind of behavior matches the java.util.Map. But coherence cache is a cluster/distributed environment. In the above example, if on another data node, value3 = cache1.get(key1) will get the original attribute value in value3, since the deserialize object will always get the original value, unless the new value is put in explicitly by cache1.put(key1, value1).
    In this case, should cache1.get(key1) always return a clone object make more sense?
    Thanks

    You observation is correct. More specifically for cache topologies which include an in-process cache Coherence may return the same object reference for repeated get requests on the same key. I say "may" because for any variety of reasons we may also have to retrieve a fresh copy from a remote cache server. When possible we will return existing objects for performance reasons avoiding costly things like network hops, and de-serialization. Any modifications made to an object returned from the cache will not be made automatically available to other cluster members. Additionally if these modifications are made concurrently with another thread performing a cache.put() on the same value could result in a corrupt cached value if your serialization methods are not thread-safe. Best practice dictates that unless you are sure that you are using a cache topology which does not include an in-process cache that you treat the values returned from the cache as immutable, and instead deep clone() it before making any modifications.
    The distributed-scheme and remote-scheme are the only types of caches which do not include in-process caching, and thus always return "mutation safe" values. The most common in-process cache topology is near-scheme, but others include replicated-scheme, optimistic-scheme, local-scheme, and the programatically created ContinuousQueryCache.
    thanks,
    mark

Maybe you are looking for

  • G4Ti4200-VTD64 voltage incompatibility with MSI K7N2 Delta-ILSR??

    Hello,     I have the MSI G4Ti4200-VTD64 (4X) video card..  I want to upgrade my motherboard to K7N2 Delta-ILSR. Is there any voltage incompatibility?? I heard that new mother boards will support only AGP 1.5V. Is the AGP voltage of K7N2 Delta-ILSR 1

  • Table Control BDC to CHANGE the contents problem

    Hi, I am having a problem in BDC. The screen is having a table control and I want to change the contents depending on certain conditions. This BDC is not to upload the data but to change already existing data. How can I dynamically know the contents

  • Blobs and bfiles

    i hav tried many examples of blobs and bfiles but without any success. when i used bfiles it creates a directory but i cant see the directory in the drive. even with blobs i have never been able to insert rows into it. i cannot even use Select * from

  • Tree Map in MSChart

    Hi, I want to create Treemap / Heatmap using MS chart (System.Web.UI.DataVisualization.Charting). Is there any sample code to start with. I don't see any related SeriesChartType for Treemap. Please let me know is there any solution for this. Thanks,

  • Possible to join multiple internal tables ?

    Is it possible to join internal tables like this: itab1: fields are matnr f1 f2 itab2: fields are matnr f3 f4 itab3: fields are matnr f5 f6 required final-itab: fields are - matnr f1 f2 f3 f4 f5 f6 (which are joined by matnr) Thanks.