Java Home Directory

Hi,
I need to figure out where java is being installed on the system / not instsalled
for e.g : C:\Program Files\Java\jdk1.6.0_16 or D:\Dev Tools\Java\jdk1.6.0_16 ...
In short i want to search Java Home path @ runtime.
Thanks,
Dhaivat Parekh

Hello ,
Have you found an answer, as we are trying to do exactly the same?
Many thanks,
G.

Similar Messages

  • Finding java home directory during runtime

    Hello dear all,
    My problem is that i need to locate the java home directory dynamically during the runtime
    of my application in order to use the /bin/jar tool.
    Can you please provide me some help?
    Thanks in advance,
    Artemakis

    The different OS's all have a facility (usually called environment variables) that contains OS parameters. If you place the location of the java home directory in one of the parameters it can be retrieved from within a Java program. An example entry would be JAVA_HOME=C:\Program Files\Java\jdk1.5.0_01 (in Windows)
    The method to do this varies by version. Java 5 has a method in the System class, getenv(JAVA_HOME) that does this.
    Earlier versions must pass the parameter name and value in at JVM startup, then the value can be retrieved by a java statement.
    // This passes it in
    java -DJAVA_HOME=C:\Program Files\Java\jdk1.5.0_01 <yourClass>
    // This retrieves it
    System.getProperty(JAVA_HOME);

  • Show Unix home directory in Java code

    Does anyone know how to show Unix home directory in java?
    Thanks a lot,

    With that in mind, I must add that the [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperty(java.lang.String)]System.getProperty() method will be handy.

  • Get home directory of java

    can any 1 help me on how to get the home directory of java??
    either using java or batch file
    thanks

    thanks
    it returns c:\Program Files\java\jdk1.6.0\jre
    but
    is there any way that can result in getting the bin folder(the 1 we usually compile program) or the jdk1.6.0 folder itself instead of
    c:\Program Files\java\jdk1.6.0\jre ??
    thanks

  • Need to write/delete a file (token) to/from user's home directory

    I want to build a class that runs on Windows/Unix clients. It needs to get to users' home directories (both environments) and write the token on login, delete it on logout.
    What method (or code snipet) would get a user's home directory?
    What method (or code snipet) would write/delete a file from it?
    Thanks much

    Even if you are not writing an Applet, this is applicable. But I thot if you were, you might need this.
    See 'SignedAppletDemo.java'
    http://developer.java.sun.com/developer/technicalArticles/Security/Signed/

  • How To Find Oracle Home Directory Path...

    Hello,
    I am working on deployment of java web service on Oracle Application Server(LINUX) 10g, EBS - R12.
    I am working on other system and i want to deploy web service remotely on application server.
    And i am not getting the oracle home directory path. I want to find the home directory path remotely.
    so suggest me how to find out path of that.
    or weather i have to install jdevloper on server system and than i have to deploy it,
    or any other alternative way is available.
    Reply as soon as possible......

    Thanks for your reply.
    It's precisely the registry key which got tampered, and there's no ORACLE_HOME environmental variable(Or that too is tampered)
    Now,how to set it to one of the Oracle home directories?
    Regards,
    Bhagat
    !!!!!!!!!!!!!!!!!!!!

  • JAVA-HOME not found in this environment?

    Hi, i'm from Argentina. ?'m installing (because i want to learn) Dspace. My machine have windows 2003 Server.
    The steps of the installation are :
    *Java SDK 1.5 (I've installed jdk 1.6_10)
    * PostgreSQL 8.X for Windows
    *apache ant
    *tomcat
    *MAVEN
    I EXECUTE IN CMD:
    mvn package
    and the error is "JAVA-HOME not found in this environment . Please set de JAVA-HOME variable in your environment to match the location of your java installation."
    I have this variables configured as System Variables:
    JAVA-HOME C:\Archivos de programa\Java\jdk1.6.0_10\bin
    PATH ;C:\Archivos de programa\Java\jdk1.6.0_10\bin (IS THE ONLY PATH THAT IS THERE)
    Please help me , I don't know how to configure it, this is the last configuration i made.
    Thanks you
    Carla Bongiovani

    Hi Carla,
    try to set "JAVA_HOME" in that way (select main directory, without bin):
    C:\Archivos de programa\Java\jdk1.6.0_10\(First shot on google: https://wso2.org/project/wsas/java/1.1/docs/setting-java-home.html)
    BTW, variable name should be "JAVA_HOME" and not "JAVA-HOME" (?).
    regards,
    zajjar

  • Reading from home directory in linux using ~/ or $HOME and BufferedReader

    I'm working on an app that reads in a number from a user's home directory using BufferedReader. The file is written by an external script to ~/filename. I don't know if the user of the app's home directory will be /homes/username, /home/username, or something else. I would prefer to read in a similar fashion:
    BufferedReader in = new BufferedReader( new FileReader("~" + File.separator + ".AppDisableUntilDate") );
    Unfortunately, this causes the following error:
    java.io.FileNotFoundException: ~/.AppDisableUntilDate (No such file or directory)
    less ~/.AppDisableUntilDate does read the file. Using $HOME in place of ~/ also fails. Any ideas what might work?
    Thanks,
    Joel

    ~ is understood only by the shell. And not by every shell either.
    Korn and Bourne-again shell (ksh and bash) understand it, I would conjecture, Bourne shell (good old sh) does not.

  • Home Directory for AD on remote machine

    Hi,
    Requirement is like this:-
    As user is provisioned to AD a home directory for user is created on remote computer with name of user. I had wrriten a VB script to create a folder in users folder(folder already shared) on remote machine. I am able to sucessfully create the folder when i run script through command prompt. Now i write a java code to run the script with following command in java code.
    Process process = Runtime.getRuntime().exec("cmd /c cscript d:/users "+userid + " " + action);
    I am able to run the java code from eclispe and folder is created in users folder on remote machine.
    Now i had added a process task in AD process form and attached the adapter in which this java code is executed to run the script and i called this on response code (sucessfully provisioned) of AD .now when i provisoned user to AD process is called but error is their as cmd is not a command on linux... how can i run the script on linux.
    2) If folder users folder is not shared i have to give permissions on folder to particular user with userid and password to create its home directory in it how can i achieve this using vbscript??

    I assume you are creating folders in a file server and its a windows machine , is it ?
    You can install a remote manager on file server or on any other machine in network and execute your scripts remotely using remote manager
    Also you can execute your script like wscript c:\CreateFolder.vbs
    Thanks
    Suren
    Edited by: Suren.Singh on Aug 10, 2010 3:20 PM

  • Invalid Java Home

    I am trying to install WebLogic on a 64-bit Cent-OS server. I have read instructions all over the place but no matter what I try I keep getting the error message "Invalid Java Home" when I get to the JDK selection section. I have tried the interactive mode and the graphic mode with the same results. I don't seem to be able to generate a log file either. What home am I suppose to be pointing this to? I have the installation jar file in the following location:
    /oracle/software/WebLogic_Server/wls1035_generic.jar
    I have the JAVA_HOME set to /usr/java/jre1.6.0_18 and the PATH set to $JAVA_HOME/bin:$PATH or /usr/java/jre1.6.0_18/bin:/usr/local/bin:/bin:/usr/bin:/home/emgc/bin. I have also verified that there is plenty of space available.
    Any assistance would be greatly appreciated!

    Your JAVA_HOME env variable seems to be pointing to a JRE home directory ( /usr/java/jre1.6.0_18 ) instead of a JDK home directory (which should be something like /usr/java/jdk1.6.0_18 )
    It might be a documentation issue, or there could be some issue with the currently installed Sun JDK and you should consider using JRockit 64 bit instead.

  • JDK Home directory

    Hello
    I need to use an enviroment for java but this program or say enviroment asks me the path of the JDK Home directory( as I think it needs the j2sdk library or the standard classes ). but I can not find the path of thes classes (such as System, javax.swing.JButton).
    just the question is (where can I find JDK directory while I setting up the j2sdk in the c:\j2sdk).
    thanks in advance.

    but this program or say enviroment asks me the path of the JDK Home directoryMay be 'this program' has its own settings option where you can enter the JDK directory. Check the menu commands and find where you can enter the directory name. Enter the JDK installation folder name.
    Or
    Include the <JDK installation folder name\bin> (Ex: c:\j2sdk\bin) in the path of your OS Environment.
    I think it needs the j2sdk library or the standard classesThey are automatically included in the classpath.

  • "Invalid Java Home" when installing Oracle Weblogic 11g (10.3.1)

    Hi folks,
    I'm trying to install Oracle's Weblogic 11g (10.3.1)
    (http://download.oracle.com/otn/nt/middleware/11g/wls/wls1031_generic.jar)
    The installer starts, but does not detect the JDK home (which I expected). It does however let you browse the file system to select a home. I've tried selecting the following:
    /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
    but I get an "Invalid Java Home" error.
    According to the documentation, Weblogic should run on a 1.6 JDK.
    I notice that there are a few other Java related issues on these forums. Does anybody have any clues?
    It sounds like the Apple JDK needs patching to make it usable by some Java apps. Bring on the 10.6 Java patch!

    Just letting everyone know that the answer can be found here:
    http://blogs.oracle.com/emorales/2009/06/weblogicover_mac_osx.html
    It seems that we have to "dummy up" a jre/lib directory to fool the Weblogic JDK detection check.

  • How does the JRE determine java.home?

    I recently upgraded from jre 1.4.1 to 1.4.2.
    I'm having problems with applets, and I've traced the problem to the fact that java.home still points to the old JRE directory. Here is a line from the system properties dump in the java console:
    java.home = C:\PROGRA~1\Java\J2RE14~1.2_0
    That directory doesn't exist anymore. The directory that contains the jre is now c:\program files\Java\j2re1.4.2_01.
    I properly uninstalled 1.4.1, and I've tried uninstalling everything java related, manually deleting everything I can find (files, folders, registry settings) related to java or sun, and reinstalling, and this problem is still there.
    I've also tried setting the property in the JAVA_HOME environment variable as well as setting it as a runtime option in the java control panel ( -Djava.home=. . .). No dice.
    How does the JRE determine java.home? Is there a way to manually set the path?

    Check regedit with the oldvalueThanks -- I tried that. The old value is not in the registry, and all of the registry settings for java.home point to the correct directory. The java.home value that ends up inside the plugin must be determined some other way (at least in 1.4.2).
    If anyone out there knows where it comes from, please let me know!
    Thanks.

  • Java Home symbolic links broken

    I followed a tutorial to install Tomcat on Mac OS X. When running, I got an error saying /Library/Java/Home/bin/java: No such file or directory. After going to /Library/Java, I saw that Home was a broken symbolic link to /System/Library/Frameworks/JavaVM.framework/Home. So, going to /System/Library/Frameworks/JavaVM.framework I saw that the Home file there was a broken symbolic link to /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home. As you could guess, CurrentJDK was a broken symbolic link to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents, and /System/Library/Java/JavaVirtualMachines/ doesn't even exist. Where should I set all of these to?

    Have you installed Java yet on Lion?
    http://support.apple.com/kb/DL1421

  • ERROR "JAVA HOME not set"

    Hi,
    I have installed Hyperion V 11.1.2 on windows 2003 server in the D drive on my laptop.when i try to start configuration utility it says "JAVA HOME IS NOT SET".I have installed java in my laptop.
    can any one please help me how to set java home.

    Hi,
    The JAVA_HOME is set in a script which is called when the configuration utility is run.
    Check you have a JRE directory under D:\Hyperion\Common
    If you don't then the installation has gone wrong and you will need to install again.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Payment block reasons

    Hi, what are the settings i need to do for payment block reasons,  i am working in quality management, when i don't approve the quality check, it is allowing for outgoing payment, and it should work like this once i approve the invoice and it should

  • I can't import LX3 videos in LR4.x on win7-64bit

    I have the following issue. I can't import the Panasonic LX3 files in Lightroom 4.x (including 4.2) on my main Windows 7-64bit PC. I get the error message "The movie files contain no video frames". All RAW files from the LX3 are imported correctly! S

  • Not able to do a google search

    whenever i try to do a "Google'" search, I get an error Message: Firefox cannot find the server @ www.google.com check your computer's network connection make sure Firefox is able to access the web

  • How can I sync my contacts and calendars through iTunes again?

    Since I upgraded to 2.0.1 I used to sync my iPhone over the air. Now that I'm going abroad I'd like to sync through iTunes again, to avoid high roaming costs. But I can't find a way to tell iTunes to sync calendars and contacts again. It tells me tha

  • New Member/Wifi Question

    Just purchased my first Blackberry an 8530 Curve. I am very pleased with it. One problem is attempting to connect to my home wifi network. It is a Wireless G Linksys router with WPA Security. My BB will not connect although it finds the network immed