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

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 the \filter directory from registry (or other) during installation of the plugin

    Hello
    I made a script to install the plugin because it needs some libraries to be installed as well, but during the installation, the filter directory isn't defined (it isn't the same for each platform or language)
    for example my filter folder is :
    E:\Program_Files\Photoshop CS2\Modules externes\Filtres
    how do i get this filter directory from registry (or with another way)
    thanks a lot
    Jeff

    sorry i made a little mistake (didn't poste the updated version of my code)
    here is the right code:
    [Code]
    var
      maxnb8bf : Integer;
      maxDirectory:        String;
      nb8bf : Integer;
      PreviousDirectory:        String;
    procedure ProcessDirectory (RootDir: String; Progress: Boolean);
    var
    NewRoot:        String;
    FilePath:        String;
    FindRec:        TFindRec;
    n1 : Integer;
    n2 : Integer;
    begin
    NewRoot := AddBackSlash (RootDir);
    if FindFirst (NewRoot + '*', FindRec) then
    begin
    try
    repeat
    if (FindRec.Name <> '.') AND (FindRec.Name <> '..') then
    begin
    FilePath := NewRoot + FindRec.Name;
    if FindRec.Attributes AND FILE_ATTRIBUTE_DIRECTORY > 0 then
    ProcessDirectory (FilePath, Progress)
    else
    begin
            if (NewRoot <> PreviousDirectory) THEN
            begin;
               if (maxnb8bf < nb8bf) THEN
               begin;
                   maxnb8bf := nb8bf;
                   maxDirectory := PreviousDirectory;
               end;
               nb8bf := 0;
            end;
            n1 := Pos('.8bf', FilePath);
            n2 := Pos('.8BF', FilePath);
            if ((n1 > 0) or (n2 > 0)) THEN
            begin;
               nb8bf := nb8bf + 1;
            end;
            PreviousDirectory := NewRoot;
    end;
    end;
    until NOT FindNext (FindRec);
    finally
    FindClose(FindRec);
    end;
    end;
    end;
    function InitializeSetup(): Boolean;
    var
      V: string;
    begin
      if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe', 'Path', V) then
        MsgBox('Value is "' + V + '"', mbInformation, MB_OK);
      Result := TRUE;
       maxDirectory := '';
       nb8bf := 0;
       PreviousDirectory := '';
       maxnb8bf := 0;
       ProcessDirectory (V, true);
       //if (maxDirectory <> '') THEN
       // begin;
       //      MsgBox('Value is "' + maxDirectory + '"', mbInformation, MB_OK);
       // end;
    end;
    function NewTargetDir(Param: String): String;
    begin
      Result := maxDirectory;
    end;
    Regards

  • How to get ADS installable

    Dear All,
    I am using SAP NetWeaver 7.1 SP5 J2EE trial version. Could any body conform that ADS comes with same package. I am not able to see ADS installed along with SAP server.
    From where I can get ADS installable file? I do not have market place user/pwd.
    As per this blog I could not get ADS installable without market place user/pwd.
    My struggles with the Adobe Document Services in WAS6.40
    Any suggestion would be highly appreciated.
    Thanks,
    Prakash

    I am using Netweaver 7.1 SP5 trial version. While opening server and looking for configuration in SAP Network Administrator I navigate to Adobe Document Services to install credentials I found:
    Adobe Document Services: Configuration
    There is no Adobe Document Services running on your system
    In my SAP server installation I did not see any directory 'AdobeDocumentServices' in directory 'global'.
    \usr\sap\J2E\SYS\global\AdobeDocumentServices\TrustManagerService\trust\credentials
    So I manually created directories in 'global'  \AdobeDocumentServices\TrustManagerService\trust\credentials and copies credentials file. restarted my server. even I am getting the same thing in SAP Network Administrator
    Adobe Document Services: Configuration
    There is no Adobe Document Services running on your system
    In document you provided its written for ADS Prerequisites are:
    Adobe document services are installed on your system.
    I am totally confused...somebody can help me!!!
    regards,
    Prakash

  • How to get WAS Installation Number and  System Id?

    Anyone knows how to get Netweaver WAS Installation number and system id using java? I need these numbers to generate a unique key.
    Any help would be much appreciated. Thanks.

    Hi Maksim,
    I'm trying to do the same thing in webdynpro, but every time I get the 'ClassCastException'.
    InitialContext initialCtx = new InitialContext();
    MBeanServer mbs = (MBeanServer)initialCtx.lookup("jmx");
    <property name="ServicesReference" value="sap.com/jmx"/>
    <property name="LibrariesReference" value="sap.com/tc~jmx"/>
    the JNDI look up has this entry -
    + jmx
    + [Class Name] : com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain
    + [Object Value] : NON Serializable Object
    J2EE Engine is 6.40.
    could you please tell me what I'm missing.
    Thanks in advance,
    Rajiv.

  • How to get "Windows Installer CleanUP" application.

    I use PC Vista Home Premium, and I use Adobe Acrobat Standard 8, till now it is working very well and nothing wrong. I would like to install an application of "Windows Installer CleanUP" to my PC for sometime in future I may need to use it, but I do not know how to get it to download and install the "Windows Installer CleanUP" into my PC Vista Home Premium.
    Please help and teach me. Thank you for your time and attentions.

    Since that is a MicroSoft product, you might have more luck at MicroSoft support site or forum dealing specifically with MicroSoft products.

  • How to get JDK installation path

    Hi,
    I would like to get JDK installation path in linux, is there any way to get the same.
    For example I have installed JDK in "/usr/java/j2sdk1.4.1" I need this path..
    It would be great if any one help me solve this.
    Thanks in advance.
    Regards,
    Venkat

    hi,
    System.getProperty("java.home");

  • How to change default installation directory sapinst_instdir TO other drive

    Hi,
    I am installing ECC 6.0 and have enough space in my disk for data files.
    I have alloted 20GB in C: drive which also comprise of Operating System.sapinst_ instdir directory grows more than 10GB and due to lack of space installation fails. How can i change th default sapinst_instdir directiory from C drive to other drive. can i use any software to change partition? ( with OS windows server 2003)
    I have also encountered an error at import phase of first job and after changing *.TSK file the installation proceeds. will this cause any serious problem.
    regards,
    Anand

    Hello,
    I understand from ur post is u want to create the instalaltion logs on another directory instaed of C:\ drive....if so u can follow the procedure as describe below..
    create temp directory in any other drive called D:\ drive...
    go in to that temp drive.....
    and fire the executable from that temp directory.....if u r executable in e:\ drive then....
    d:\temp>e:\installer\insatall.exe
    the above command creates all logs one by one in temp dorectory of D:\ drive instaed of c:\ drive..
    Thanks

  • How to get immediate parent directory name of a file

    Hi,
    I have file Object that points to a file. I want to know how I can get just the name of the parent immediate to the file For example, if the path of this file is, c:\\ProgramFiles\first\second\third\myFile.txt
    In the above, how can I obtain the last directory in which myFile.txt resides ?
    Thanks
    Sangeetha

    File myFile = new File("c:\\ProgramFiles\\first\\second\\third\\myFile.txt");
    File parentFile = myFile.getParentFile();
    String parentDirectory = parentFile.getName();
    System.out.println("Parent directory is "+parentDirectory);Here's the explanation...
    1) New File is created
    2) File.getParentFile returns the immediate parent of the current File, which happens to be a directory.
    3) File.getName() returns the name of the File, without the entire directory structure.
    Hope this helps :)
    Simon

  • How to get Vista Installation Disk from Toshiba?

    I've been working with Microsoft support to resolve a security issue on my Satellite Pro A210, and have now been asked to use a Vista installation disk.
    Microsoft says that I am entitled to an installation disk from the original supplier of my kit - Toshiba. But one did not arrive with my laptop - only a recovery disk was supplied.
    How do I go about acquiring a Vista installation disk from Toshiba?
    Regards,
    Kevin C.

    Mores is right. Toshiba doesnt offer installations CD with operating system only. you will get recovery image.
    Recovery image definition:
    +Recovery Image is an exact copy of a computer's hard drive and contains the exact, byte-by-byte copy of a hard drive partition.+
    +The copy includes all the partition information, boot sectors, the file allocation table, operating system installation and different application software.+
    +Using Recovery installation CDs/DVDs, you can restore your system after heavy data loss caused by an operating system crash, virus attack or hardware failure complete.+
    +Recovery image installation procedure allows the user easy and fast system installation. Unfortunately it is not possible to restore only certain files from a disk image.+
    +Every recovery image is designed for one specific notebook model and it can not be used for any other notebook series.+

  • How to get the root directory of a domain?

    I have a domain setup at
    C:\bea\user_projects\domains\myDomain
    I have tried the following;
    Getting the domain object : get attr DomainConfiguration from DomainRuntimeServiceMBean
    Get root dir : get attr RootDirectory from domain object
    It returns ".", but I need the full path.
    Is there an issue with the RootDirectory from domain object or in my approach?

    John,
    OK. If you want to go the JMX route, have a look at the CurrentDirectory attribute of the ServerRuntime mbean. It would report your directory as this:
    C:\bea\user_projects\domains\myDomain\.
    Mike
    Weblogic/J2EE Security Blog: http://monduke.com

  • How to get  current working directory of the ftp server,in java application

    Hi All,
    I?m FTP?ing the file using java.net.url.
    Here is the snippet of the code:
    public void ftpFile()throws ChrsException
    try
    System.out.println("FTPing the file '"+localfile+"'");
    OutputStream os = openUploadStream(targetfile);
    FileInputStream is = new FileInputStream(localfile);
    byte[] buf = new byte[16384];
    int noOfBytesRead;
    while (true)
    //Read the data from the source File into buf
    noOfBytesRead = is.read(buf);
    if (noOfBytesRead <= 0)
    break;
    //Writes the data present in the buf to the target file
    os.write(buf, 0, noOfBytesRead);
    os.close();
    is.close();
    close();
    System.out.println ("The file '"+localfile+"' is Sucessfully FTP'd to '"+targetfile+"'");
    catch (MalformedURLException malExcp)
    System.out.println ("Invalid URL. Error in FTP'ing the file: \""+localfile+"\"");
    catch(IOException ioe)
    System.out.println ("Error in FTP'ing the file: \""+localfile+"\"");
    private OutputStream openUploadStream(String targetfile) throws MalformedURLException, IOException
    URL url = null;
    //Creates a URL object with FTP protocol
    if (user == null)
    url = new URL("ftp://" + host + "/" + targetfile + ";type=i");
    else
    url = new URL("ftp://" + user + ":" + password + "@" + host + "/" + targetfile + ";type=i");
    urlc = url.openConnection();
    //Get the OutputStream that writes to this connection.
    OutputStream os = urlc.getOutputStream();
    return os;
    Now I need to find what the current directory is when the user logs in with username and password on to the FTP server in java.
    Thanks in Advance.

    as soon as user logs in he is taken to the directory
    "ftproot/pub/abc".
    now If I execute pwd command , is hould be able to
    get to know tht user is under "ftproot/pub/abc"Three respected posters, well two plus me ;-), have just told you otherwise. The information about the current directory is (a) secure and (b) useless to the user, as he can't do anything with it. The user doesn't want to know that at all and you shouldn't try to tell him. And in any case FTP doesn't support it, again for security reasons, so you can't do it.
    Just accept it.

  • How to get the current directory as File object

    Hi guys,
    i want to get the current working directory as a file object.
    plz help me on that if there are any standard methods present for this.

    new File(".");

  • Get j2ee application directory

    Hi,
    Is there a way to get the disk path to the current
    j2ee application home at runtime. (i.e. .../j2ee/home/applications/myapp)
    I am generating html/csv files there and then redirecting
    to them.
    The same application is being deployed to multiple homes, so
    hardcoding the disk path in a properties file or anywhere else doen't work too well.
    thanks

    you can try using the getRealPath(...) method on the SevletContext

  • How to get last visited directory in JFileChooser?

    Hi,
    I m using a swing application.
    I just want to know if i select any fuile in JFileChooser once then if i again go to select file then it must open the last visited directory.
    Can anybody tell me how to do that?
    Thanks
    Dheeraj

    You just save the result of the last JFileChooser, and feed it into the next instance of the JFileChooser... or just reuse the first instance again and again....
    JFileChooser jfc1 = new JFileChooser ( new File(".") );
    File selectedFile = jfc1.getSelectedFile();
    JFileChooser jfc2 = new JFileChooser ( selectedFile );regards,
    Owen

Maybe you are looking for

  • New iMac won't recognize my external monitor.

    I just upgraded my workplace computer to a late-2012 iMac (with the thin edges) from the previous older model. I have an external monitor that I use as a secondary screen - a Samsung SyncMaster BX2440 - that worked great on my older machine using the

  • IChat Deteriorates

    I am having quite an odd problem with iChat. When I connect to my home computer, the upload speed from home deteriorates from 15 fps to about 1 fps over the first 15 seconds of connection. What's odd is that while I see my family at 1 fps, they see m

  • PL/SQL not working

    Hi there, I wrote a procedure which calls a function to get the query. The SQL in the query is ok, since I have testet it in SQL scratchpad. But wehen I call the procedure it says "Invalid SQL Statement". Can someone please point me to my mistake. Th

  • Preview 4.2 scaling printed pages way down

    Why would my standard pdf files suddenly be scaled down to approx., 60 percent when I select the print button? This has never occurred before. If I chose Command Print the scale is correct and prints full page.

  • Typewriter function

    I have templates saved. When i edit using the typewriter function and add a stamp signature some users I e-mail to cannot see changes. I know I can print to to pdf and save but is there another way?