Get installation directory programmatically

is it possible to get user installation directory of jdk programmatically?
i.e. j2se was installed to
f:\mydir\jdk14
how to get the directory in java program?
java.home is run-time environment directory looks like c:\program file\..., not user installation directory i needed.
thx

The JDK is usually NOT installed in the same place as the JRE.We are obviously talking about different things.
In my JDK C:\j2sdk1.4.2_05 there is a JRE C:\j2sdk1.4.2_05\jre
They can be installed in different places but I assume you are talking about different installs in different places. i.e. the JDK and JRE have been installed seperately.
I need to obtain user installation directory programmatically You can look at the PATH and the registry. However if the user installs more than one JDK, which copy are you going to chose. Most applications which need a seperate JDK search for the JDK when installed and then ask the user which JDK to use.
- System.getProperties() will not get the directory - i have tested with all jdks and all windows OS.
One thing you can do with ant is to write the directory used to build an application into the application for it to find. I would concider this bad practice and unreliable however.
who can answer my Q?The reason the JDK is seperate from the JRE is so that once development has be done you can run the JRE and not need the development portions which come with the JDK. If you need still need components of the JDK, why don't you start the application in the JDK.

Similar Messages

  • How to get jdk installation directory programmatically?

    when we install jdk, we can select a directory to install it, i.e.
    F:\myfolder\jdk1401
    this is not JRE directory and can not be got by java method System.getProperties()
    my Q is:
    how to get the directory progammatically in Java program?
    thx

    Most commercial software gives the user the oppotunity to specify the JDK they want to use. Some search for the JDK for them, but often involve a directory search. The registry trick should work, but you need to check the directory still exists. The user can move/delete it without the registry being updated, this is very easy if the drive is a network drive.
    Note:
    if the jdk is installed on a network drive, the registry may not be setup for each user. They can see it but it does not appear in the registry.
    If you setting up a web server e.g. tomcat, it typically runs as a different login id to the user installing it. Network drives are different for different users, so network drive letters may not work. Using the UNC instead of the drive letter can get around this problem.
    If the user tries to install his run anay where software on a non-windows system, there will be no registry.
    Good Luck.

  • How to get J2EE installation directory?

    when we install J2EE, we install it in a directory, i.e.
    c: \ j2sdkee1.4
    but how to get the directory programmatically on Windows OS using Java or C++ launguage?
    thx

    bring to top to get answer

  • I need to Add the configuration file '.airinstall.cfg' to the air bundled runtime installer directory. where do i get the airinstall.cfg from

    i need to Add the configuration file '.airinstall.cfg' to the air bundled runtime installer directory. where do i get the airinstall.cfg from what are the contents of the .airinstall.cfg file please help.

    http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html

  • Get the directory information of Weblogic installation

    We have a scenario , wherein we have placed an xml in a specific directory in weblogic. For eg : $WLS_HOME/DefaultDomain/config/fmwconfig/mbeans/xyz.xml
    Would like to know
    a) whether we can get the value of $WLS_HOME
    b) whether we can get the directory path for a domain (domain directory)
    through WLST.
    Thanks
    Joseph George

    The ServerRuntime MBean has a getCurrentDirectory() method. You can call this from WLST.
    serverRuntime()
    print cmo.getCurrentDirectory()

  • Creative Cloud - BUG Changing Installation Directory for Apps

    I searched and could only find this similar post here
    http://forums.adobe.com/message/5498967#5498967
    Which stated the issue I am experiencing.  In the preferences of the creative cloud desktop program I changed the installation directory to D drive because I have my main hard drive partitioned and the programs would take up too much space on C.  Regardless of the change in preferences the applications were still installing to my C drive.  I tried restarting and reinstalling and nothing seemed to work. 
    Finally I decided to reallocate my D partition back to C, I have yet to complete this because I am waiting for all the data on D to be transferred to an external drive so I can recombine it to C without losing data ( I don't know if this is necessary, I haven't recombined partitions in the operating system before, but just to be safe)
    ANYWAY
    As I am waiting for the transfer (Over 120gbs takes a while)  I changed the installation directory in the Creative Cloud preferences back to C and went ahead and installed the program I was trying to prior to all this.  Guess What?  It installed to my D drive!!!
    This isn't a serious bug for me, just incredibly annoying and causing a lot of extra work on my part just to install the program I wanted.  However for someone who requires a different directory to install to and cannot rearrange their computer to accommodate this bug I could see it being more serious.  Has anyone else had this issue and did you find a solution?  Thanks.
    P.S. Adobe you rock, I hope your other CC programs don't feel rushed for release like your installer does

    ADOBE WILL TRY TO DELETE YOUR LEGACY APPS!!!!  Do NOT let them! They could put you out of business! Here is a tech support transcript, see for yourselves:
    Vipin: May I have your permission to connect to your computer remotely and try to solve the problem while you watch?
    ADOBE CUSTOMER: I need to know that NONE of my legacy adobe apps will be affected. CS5 suite and CS6 products will NOT be affected is that right??????????????
    info: Your chat transcript will be sent to dixxx.net at the end of your chat.
    Vipin: It will be affected.
    ADOBE CUSTOMER: WHOA! you are saying that my CS% and CS 6 apps will be hurt and not run correctly is that right?
    Vipin: We need to remove all the Adobe apps installed on your computer.
    Vipin: Is that okay.
    Vipin: May I have your permission to connect to your computer remotely and try to solve the problem while you watch?
    ADOBE CUSTOMER: There is no way I give permission to delete CS5 creative suite, CS6 video production suite or hurt them in any way what so ever. I have THOUSANDS of dollars of plugins and other workfow products that depend on them. Sorry but my only recourse is to
    ADOBE CUSTOMER: see if you have ANY loyalty to an OVER 30 years adobe customer (me) when you demand payout for the remaining 5 months of the subscription. I'm betting you will just send the bill to collections for non payment. If so, you WILL be sued for non service and non delivery of product. And yes, I am ready to spend over xxxx on a suit vs adobe because of how you have treated me. The point is I know that I am not alone, and that's sad.
    Then after TECH NO SUPPORT, CSRs try to 'handle' me:
    If you do decide to cancel, we can refund your subscription.
    If you stay with the service, we can provide 2 free months as an apology for the technical difficulties. We cannot provide a free year.
    Please let me know which you would like to do.
    Thanks,
    Britt
    Like · Reply · 35 mins
    ADOBE CUSTOMER:You want me to stay with a service that provides no product? And has not provided me with a usable product since October of 2014? And now the word is out that you are raising subscription prices after the first year? Who do you think you are? You HURT peoples ability to earn a living! You cost us hours and days and months trying trying to fix your problems so we can move forward with your products? Who in the hell do you think you are? Tell you what, dont cancel a thing. A media blitz and maybe a subpoena to San Jose is the right move to protect peoples rights. Your company needs to learn a lesson in how to treat legacy customers. It seems no one has taught you that "if you take care of the customer, they will take care of adobe." Britt, care to guess how many dollars I have given adobe in almost 30 years?
    Adobe Creative Cloud Hi ADOBE CUSTOMER:
    We value all our customers and would love to help resolve your issue. Would you like to arrange a callback with tech support? I can make sure the technician is a senior staff member that can offer more troubleshooting solutions. Let me know if you would like to schedule this, and what a suitable time would be.
    Thanks,
    Britt
    Like · Reply · 19 mins
    Adobe Creative Cloud Regarding Creative Cloud prices, it is noted on the purchasing page that some subscriptions offer "promotional rates for the first year only." Our full subscription terms can be viewed here: https://www.adobe.com/misc/subscription_terms.html
    -Britt
    Like · Reply · 18 mins
    ADOBE CUSTOMER: You see, that is EXACTLY how you should take care of a customer. Tell them they are wrong and have it NOT RELATED to a simple request to FIX a company software PROBLEM. Tell your customers that after FOUR months of unusability of your product, DAYS of the customer trying to fix the company problem, that your solution is give them TWO months FREE then JACK the price up for them! You MUST have thousands of people in LINE to YOU to get this celebrated DEAL!
    Like · Reply · 6 mins
    ADOBE CUSTOMER: I have a hunch some adobe board members are going to have fun with your conversation and offer, Britt. I would hush up now before you have to look for a different job because I know you mean well BUT you have no experience or skills solving a client's issues and in fact, you are hurting adobe's future earnings.
    Like · Reply · 2 mins
    Adobe Creative Cloud I apologize for the frustration regarding Adobe's pricing policy, Kee. Please let me know if you would like additional help troubleshooting the problem. We would love to locate the cause of the download issue and get this resolved for you.
    Thanks,
    Britt
    Like · Reply · 7 mins
    ADOBE CUSTOMER: The Russian cracked version of PS 2014 will have to do on another clients machine until you have a total new WORKING release. I'm tired of being your company's test pig, doing the boiler plate cleaner routines, and having the same failures. It's one thing to have broken software, but NOT acceptable to treat customers the way I have been treated, and then, be greedy on a remediation offer from you.
    You say,"We value all our customers."  Again, clearly NO ONE from the BOD has taught you that if you take care of the customer, then the customer will take care of adobe.
    You guys and gals have essentially asked for a fight, and a fight you shall have. good night.

  • Installation Directory BO/InstallData/InstallCache/ needs a lot of space

    HI together,
    maybe someone of you know a solution?
    We have installed a BO4.0 Enterprise Server, and we installed a lot of patches since now.
    The installation directory (BO/InstallData/InstallCache/) needs now a lot of space.
    Is it possible to reorganise this directory or is it possible to delete some files?
    Thanks in advance
    David

    Hi David Bartuli,
    Run Disk Cleanup you will get some space.
    Right click the drive Select Properties. Click Disk Cleanup....
    If you want to reduce the number of unnecessary files on your hard disk to free up disk space and help your computer run faster, use Disk Cleanup. It removes temporary files, empties the Recycle Bin, and removes a variety of system files and other items that you no longer need.
    Edited by: pardhasaradhi.t on Oct 9, 2011 5:22 PM

  • Sequence app with modify rights to installation directory

    Hey there
    I've got an application, where the user must have Change / Modify Rights to the Installation Directory. By Default, the Installation is installed in C:\Vendor\App1. If i just install the application locally the application can be launched without any
    problem.
    I tried to sequence the App with App-V 5.0 SP2 HF4 with PVAD "C:\Vendor1" and i selected the Option "Allow virtual application full write permissions to the virtual file System" on the Advanced Tab of the Sequencer. If i start the application
    i get an error that the database (Application is an Access addin) is only in read mode, and that the application can't get startet.
    Also i'm not able to manually add or modify rights in the Installation Directory.
    Have i missed something? Isn't the Option "Allow virtual application full write permissions..." for this case?
    Thank you in advance!
    Best regards, Simon

    In the first post I read it as you captured to PVAD, and in the post above you set it to VFS.  Did you do a second capture?  If not which are the files in?
    You can always run procmons, etc, to try to figure out what is going on.  The application can always be doing something 'weird', unfortunately its hard to give you a really solid solution with all the potential variables.
    You could upgrade to SP3, and resequence.  Beyond that, you could try going into the VE, and writing a dummy file to that DIR, to see if you get any permissions error.  Does the program put itself into PATH or anything like that?  If there
    are references to the C:\ProgramData location, its possible the program is trying to write to that folder, which is the outside folder you can't write to.

  • OT: Permissions for FrameMaker installation directory

    I have never run into this before. I jumped into my FrameMaker installation directory, because some things in maker.ini are not available in the copy in my profile path (such as paste preferences), and I was blocked from saving changes because I lacked permissions.
    Why do IT departments lock that down?
    I mean, clearly programs can install there, so a virus or malicious code could still do harm, but why do they lock me, the local admin, out? Any thoughts.
    Also, let's pass along to Adobe the need to move all those ini settings somewhere else.
    Cheers,
    Sean

    Psst – if you’re getting locked out of your own c:\ drive, you’re not a local admin – you may have to “promote” yourself to give yourself rights to those folders – since Vista, Mr. Bill’s been trying to protect us from ourselves (LOL)

  • SCCM 2012 Installation Directory Registry Key chaning automatically to Old Installation Path

    Hi Guys,
    I have recently recovered SCCM 2012 SP1 CAS Site from Primary Site by reinstalling CAS site and database was replicating with Primary sites properly after CAS recovery. But we noticed that after approx. 2 hours of CAS site recovery database replication stopped.
    After long digging into SCCM log files we found that SCCM installation directory was pointing to old CAS Site Installation Directory (Which was before recovery) instead of NEW Installation Directory so we changed SCCM CAS Site Installation Directory manually
    to new installation path in below registry key and everything was running fine again on CAS Site.
    HKEY_LOCAL_MACHINE\Software\Microsoft\SMS\Identification
    But again when we restarted SMS_EXEUTIVE Service, SCCM Installation Directory again changed to old installation patch under above registry location and all is bad again. We are unable to figure out what is causing this and even we formatted our HDD before
    installation CAS Site.
    Can anyone please help to get rid of this issue. Our while CAS site is down due to this issue.
    Thanks.

    I think that you have to use the same installation directory in a site recovery scenario.
    Torsten Meringer | http://www.mssccmfaq.de

  • Installation directory of Operating System

    Hi all,
    I am trying to know installation directory of operating system. I tried to get it with System.getProperty(key). But no key returns installation directory of OS. Currently i am working with windows XP. I need to save one dll dynamically in its /Windos/System32 directory. Plz help me how to do this.

    I want to know in which directory operating system is installed dynamically. i have to download my library in windows/System32. Just repeating the same question doesn't offer any clarification.
    Why do you want to find this directory? Why do you think you have to put your DLL there? What are you trying to accomplish by doing that? That's not your actual requirement; it's a solution you've come up with to whatever your actual requirement is. If you want that question answered, I suggest you define what you mean by "the directory where the OS is installed," because in general, there isn't really such a thing. Or you could answer my question about what you're actually trying to accomplish.
    Edited by: jverd on Sep 7, 2010 12:16 AM

  • Manually coping agent installation directory in windows.

    Hi
    One of my production server's hardware is going to be upgraded from ProLiant DL380 G4 to ProLiant DL380 G5 with higher configuration in Windows 32 bit OS. My network team is rebuilding this server as a new box with the same ip address. I don't want to loose the history of this node target databases in the Grid repository for reporting purposes.
    If I install the oracle agent as a fresh installation I will loose the history. I am planning copy the entire agent installation directory to new server. I am curious to know once I secure the agent and start the agent with because ip addresses are same will it start? How to create a agent service here? Is there any manual process to create the agent service. I want to preserve the history of the node and targets in the Grid here.
    Your valuable suggestions are highly appreciated.
    Rao

    Rao,
    You won't be able to just copy the software directory to the new server. The installation process addes entries to the registry, updates the path, etc.
    The sc command allows you to interact with services. If you type "sc" at a command prompt, you will get a listing of the syntax.
    I wouldn't think that you could copy the configuration from an "old" host & use it on a "new" host. There would be too many differences that would cause conflicts. I guess you could try it & drop & recreate the objects from the repository if it didn't work.
    Thanks,
    Brian

  • Beta installer will not continue past "Select Installation Directory"

    I was able to install the beta s1as 7.0 application server on one Windows 2000 box. A second box fails to continue past the "Select Installation Directory" dialog. All buttons except the browse button do nothing. "Back", "Next", "Cancel" and "Help", they do not get focus. This is true whether I use the browse to pick the installation directory or not.

    Same Error:
    INFO: End output from spawned process.
    INFO: ----------------------------------
    INFO: Calling Action unixActions10.2.0.1.0 make
    installMakePath = /usr/bin/make
    installMakeFileName = /u01/app/oracle/product/10.2/client/network/lib/ins_net_client.mk
    installTarget = client_sharedlib
    installArguments = ORACLE_HOME=/u01/app/oracle/product/10.2/client,
    undoMakeFileName = null
    undoTarget = null
    undoArguments = null
    logFile = /u01/app/oracle/product/10.2/client/install/make.log
    progMsg = Building client shared libraries
    INFO: The output of this make operation is also available at: '/u01/app/oracle/product/10.2/client/install/make.log'
    INFO:
    INFO: Start output from spawned process:
    INFO: ----------------------------------
    INFO:
    INFO: /u01/app/oracle/product/10.2/client/bin/genclntsh
    INFO: /lib64/libpthread.so.0: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    genclntsh: Failed to link libclntsh.so.10.1
    make: *** [client_sharedlib] Error 1
    INFO: End output from spawned process.
    INFO: ----------------------------------
    INFO: Exception thrown from action: make
    Exception Name: MakefileException
    Exception String: Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/10.2/client/network/lib/in
    s_net_client.mk'. See '/home/oracle/oraInventory/logs/installActions2009-06-09_08-55-15AM.log' for details.
    Exception Severity: 1
    My .bashrc looks like:
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/10.2/client
    export ORACLE_SID=DB_1
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib

  • OpenAL.Framework installation directory???

    I recently downloaded a game from the internet on my mac (OSX Leopard). When I try to open the application, I get a message that reads the following: "Error opening OpenAL Framework: Please make sure 'OpenAL.framework' is in the installation directory." I downloaded OpenAL.framework, and I put it under Users:Library:Frameworks, but I keep getting the same error message. Is the OpenAL.framework in the wrong place? How can I fix this problem? Thanks!!!

    Welcome to Apple Discussions:
    I don't think you simply copy openal framework. It needs to be installed.
    I suggest first removing whatever you did and then visiting this page
    http://developer.apple.com/audio/
    You may need to join ADC but it's free.
    I have the latest version of Xcode installed and it appears that the full OpenAL.framework is installed and functional.
    You might also check into the audio forum here:
    http://discussions.apple.com/forum.jspa?forumID=734
    As an aside, if you downloaded the game via bit-torrent be careful of malware.
    Message was edited by: nerowolfe

  • Installing a trial version of the Illustrator and InDesign App in Creative Cloud on my Mac is impossible. Keep getting 'Installation failed' notices. More information gives 0 fatal error(s), 0 error(s). Already repaired disk permissions in Disk Utility bu

    Installing a trial version of the Illustrator and InDesign App in Creative Cloud on my Mac is impossible. Keep getting 'Installation failed' notices. More information gives 0 fatal error(s), 0 error(s). Already repaired disk permissions in Disk Utility but nothing seems to work. Exit code: 7.

    Hi Maarton,
    Please follow the link to resolve the issue: Errors "Exit Code: 6," "Exit Code: 7" | CS5, CS5.5
    -Ankit

Maybe you are looking for

  • Problem with IE9 Template

    I built a virtualized IE9 using the ZAV Studio template. However, when I test it on our environment, I get the following error when launching the virtual app: "A program on your computer has corrupted your default search provider setting for Internet

  • Cannot open Firefaox even after re-installing.

    I have not installed or changed any software or hardware but this time when I try to open Firefox and AVG neither will open.

  • Crystal Reports 2008 SP2 - Fix Pack 2.1 Readme

    Hi, Where can I find a readme of the Crystal Reports 2008 SP2 - Fix Pack 2.1 with the list of fixed issues? Specifically does this fix the issue of dates when using .NET datasets and ADO recordsets (ttx files)? Regards Craig

  • Linked Universe - Order of Objects Differs from Kernal

    When I add an object (or class) to a "kernal" universe, these objects are appended to the end of the object (class) list in linked universes. How can I make the objects in the linked universes match the order listed in the kernal? For example, if the

  • Je ne peux ni activer ni me connecter pour mon produit premiere element 12

    Impossible de me connecter ni d'activer mon produit Premiere Element 12. Il m'indique de me connecter à Internet ce que je suis déjà. ue dois-je faire ? Y-a-t-il possibilité qu'Adobe valide mon logiciel en ligne directement ? Merci