Determining path to the Java SE classes

hallo,
i need a clean and cross platform way to find the .jar containing the standard JRE classes, like java.lang, java.awt etc. to look up which classes are in a specific package (e.g. list all classes in "java.lang").
at least on mac os x, i have the problem getting the path to that .jar, which here is
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/classes.jari tried to get this from System.getProperty( ) but without success ... the "java.home" property points to /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home ; "java.class.path" lists only the custom class path of my application but not the jre's classpath . "java.library.path" is wrong, "java.ext.dirs" is wrong ;--(
of course, i don't want to do new File( new File( new File( System.getProperty( "java.home" )).getParentFile(), "Classes" ), "classes.jar" ) since it will fail on linux or windows. so what to do ? what's the mechanism for javac to find the classes if write "import java.awt.*;" ?
thanks a lot! ciao, -sciss-

i poked around in the properties and found ...
sun.boot.class.pathwhich contains the path i'm looking for . is this a "robust" property which is available in all VMs and will be supported in a future java version ; so can i rely on this ?
thanks , -sciss-

Similar Messages

  • I need the Java IDoc Class Library

    Hi,
    I'm desperately looking for the Java IDoc Class Library. What for? I'm doing a project for university and I have a test version running on my own computer (Mini WAS 6.20 with the FlightBooking example installed). The SAP Service Marketplace is for registered customers only. Since I only have a test environment (mentioned above) I can't register there and download it.
    Could anyone please send me this library by mail, to [email protected] Since I don't know how big this package is: my mail provider has a 15MB/per single mail limit. If biiger, please split.
    Yes, I'm asking for much. But I'm pretty desperate and I have to get going, since I'm running out of time.
    If there are other ways to get this library, please tell.
    Thanks
    Jonny

    Hi Johannes
    The SAP Java IDoc Class Library consists of two parts, the SAP Java Base IDoc Class Library and the SAP Java Connector IDoc Class Library. The SAP Java Base IDoc Class Library provides an API which helps navigating, reading, filling, and modifying IDocs. This base package is middleware independent. Creating, sending, and receiving IDocs is middleware dependent. To make use of the SAP Java Base IDoc Class Library you will need an additional middleware dependent add-on package implementing the defined interfaces like the SAP Java Connector IDoc Class Library.
    The SAP JCo can be downloaded from the   
    https://websmp101.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000463649
    of SAP JCo. The SAP JCo package includes the software as well as documentation, tutorial, and examples. The SAP Java IDoc Class Library can be downloaded from the same URL, and then follow the link to SAP Java IDoc Class Library. The SAP Java IDoc Class Library packages include the software as well as documentation.

  • Where should i add the java packages class path in the ORACLEJDeveloper 10g

    Hello friends,
    I have created a BPEL Program using java embedding activity.
    In it i have added some java code.
    I want to attach path of some java class packages.
    So can any one tell me solution for this.
    Thanks and regards.
    Ram Krishna Tripathi
    [email protected]

    Hello friends,
    I have made a Bpel program in oracle process manager 10.1.2 . using java
    embedding activity.
    (i) I have put the java class files in BPEL-INF /classes folder and
    SYSTEM/classes folder but still compiler is giving error that classes
    couldnot be found.
    I have set the class path in Project -> properties
    So please tell me what could be solution for this problem..
    (ii) Can the import package statements can be written in BPEL program in the
    java embedding activity ?
    Thanks and regards
    Ram Krishna Tripathi
    [email protected]

  • How to determine path of your java program?

    hi,
    i have got some code to check what type of files are in my folders so that i can display an avaliable list of eg. save games.
    the problem is that the path of the program will change with each user that uses it cos they'll keep it somewhere else.
    so this wont work
    File f = new File("C:/Documents and Settings/Me/My Documents/GAME");is there a way to determine the whereabouts of the program thats running to change this path?
    ive already tried:
    File f = new File("");
    File f = new File("/");
    File f = new File("/GAME");but they dont work.
    thanks in advance

    Thats exactly what i needed thanks.
      import java.io.*;
       //Code by Roquefort
        public class Files
           public static void main(String[]args)
             new Files();
           public Files()
             System.out.println(System.getProperty("user.dir"));
             String dir = System.getProperty("user.dir");
             char slashChar = 92;
             char slashChar2 = 47;
             String slash = slashChar + "";
             System.out.println(dir.length());
             for(int i = 0; i < dir.length()-1; i++)
                if(dir.substring(i,i+1).equals(slash))
                   dir = dir.substring(0,i) + "/" + dir.substring(i+1,dir.length());
             System.out.println(dir);
             File f = new File(dir);
             String [] names;
             names = f.list();
             for(int a=0;a<names.length;a++)
                if(names[a].endsWith("GIF"))//Change file extension, or remove if for all files
                   System.out.println(names[a]);
       }

  • Java Connectivity - No classes appearing in the Java Beans Classes dropdown

    Hi,
    VERY NEW user to Crystal Reports.  I am trying to create a report using a java class as a datasource.  I have updated the setting in the CRConfig.xml file, and can get the Java Beans Connectivity screen to appear, but is shows none of my classes in the dropdown.  I found a knowlege base entry that indicated this problem was caused by the JavaBeansClassPath value in the CRConfig.xml file being invalid.  But I've verified the location and it is pathed directly to the classes.
    Not sure what I am missing, but any help is greatly appreciated.
    Thanks!

    Ted,
    Thanks for the reply.  I checked out each of your suggestions, but haven't had any luck thus far.  Here's what I found:
    1.  We created a simple method in an existing public class to return a ResultSet.  The method looks like this:
    public ResultSet GetAllMediaTypesRS()
          String strFuncName = "ScsXDMDatabase::GetAllMediaTypesRS : ";
          ScsDebug coutDebug = new ScsDebug();
          String strSqlStmt;
          String strMediaType;
          ScsStringList sslReturnList = new ScsStringList();
          // Create the SQL to get all the Displayable Media Types.
          strSqlStmt =
             "SELECT DISTINCT mt.Media_Type_Name "
                + "FROM dbo.Media_Type mt "
                + "WHERE mt.Media_Type_Rqst_Display_Ind = 1 "
                + "ORDER BY mt.Media_Type_Name";
          coutDebug.println(strFuncName + "SQL Statement:  " + strSqlStmt);
          // Run the Query
          Statement stmt = null;
          ResultSet SQLResult = null;
          try
             stmt = GetConnection().createStatement();
             SQLResult = stmt.executeQuery(strSqlStmt);
          } //End of Try
          catch (SQLException sqle)
             if (sqle.getErrorCode() != 0)
                coutDebug.println(
                   "Error in ExecuteQuery: "
                      + "Error code - "
                      + sqle.getErrorCode());
                coutDebug.println("Message - " + sqle.getMessage());
          return SQLResult;
    The signature, and the method look fine to us, but maybe we are missing something obvious.
    2. We do use JDK 1.5 to compile the classes, but my JavaDir setting in the CRConfig.xml file points to jre1.6.0_02.  I assume this is OK.
    3. We do see java.exe start up when opening the JavaBeans connection.
    4. No firewall issues as we are inside our corporate network.
    Any other thoughts or ideas?  I did see a knowledge base entry that indicated the cause of this particular problem is that the JavaBeansClassPath in CRConfig.xml is incorrect or invalid.  I've validated the path takes me right to the classes, so I believe that is OK.  Is there some way that we can see the actual path that is searched when the JavaBeans connection is opened?
    Thanks for your help.
    --john davies

  • Replacing the java.* Classes

    I want to change the code to say, java.lang.Class for debugging/monitoring. I know the java.exe has a -Xbootclasspath/p:path option for us to prepend the new core api classes to the classpath and the source code for the core api classes are available in the jdk. But the problem is it seems that the javac.exe does not accept a class named java.*. I can use byte code instrumentation tools like Javassist/BCEL to inject code to existing system classes. But is it possible to modify the source code directly and recompile them without having to use byte code instrumenation?

    alec_lee_yl wrote:
    I want to change the code to say, java.lang.Class for debugging/monitoring. I know the java.exe has a -Xbootclasspath/p:path option for us to prepend the new core api classes to the classpath and the source code for the core api classes are available in the jdk. But the problem is it seems that the javac.exe does not accept a class named java.*. Huh? I just compiled java.lang.String using javac.

  • Where are the Java API classes?

    Hello All,
    I understand that Oracle9i uses a Java API different than those older classes found in sdoapi.zip here on the OTN.
    Problem is, I don't know where to find them in my newly-installed 9iR2.
    Can anyone help me with this simple question or point me to appropriate documentation?
    Thanks!
    -- john

    I believe the new Java API classes are slated for 10i.

  • Getting the path  of the java file your code is in

    Hey,
    How can I get the full path of where my java file is on my computer in my java code?
    Something like this is what I want:
    this.getFilePath();
    Thanks! / Ellen

    I posted a utlity class to help you do this awhile back:
    http://forum.java.sun.com/thread.jsp?thread=425748&forum=31&message=1895876
    As far as the posters question of why you would want to do that, determining the correct location to read .properties files is a pretty decent reason. Another would be determining where a JAR file is located that needs to be updated with an auto-updater. And another is determining where to save data and/or log files. And another might be to do a checksum over various pieces of a JAR to make sure it hasn't been tampered with. And another....
    I think you get the point. Because Java does not have a command line entry point (i.e. the name of an executable that was used to start it's process), this is pretty much the equivalent.
    And for all of you that use relative pathnames (i.e. starting with ./), that is just waiting to bite you. You should NEVER make the assumption that the current path is where you think it is. Much safer to use the utility above so you know for sure where your class is installed.
    Cheers!
    - K

  • Where to put the java bean classes

    Hi,
    I am very new to the web service developer pack. I have written a java bean but don't know which directory to place it. Can anyone please tell mi???
    Thanks

    put in
    WEB-INF/classes
    if is a jar file
    put in
    WEB-INF/lib
    regards

  • The Java Random class

    Hi, everyone
    I have a question about the Random class
    The following class can choose number randomly. But sometimes it chooses a number for more than once. How do I make it choose the numbers randomly but have no repetition. Thank you very much!
    import java.util.*;
    public class CodeTest
      public static void main(String[]args)
       System.out.println("random number");
       CodeTest x = new CodeTest();
       x.randomNum();
        public void randomNum()
            Random generator = new Random();
            for (int i = 0; i < 10; i++)
                int randomNumber = generator.nextInt(10);
                System.out.println (randomNumber);
    }And what if I have 15 numbers and I just want to pick out ten of them randomly, again, no repetition.
    Thank you very much!
    Edited by: Terry001 on Apr 21, 2008 7:51 PM

    Can you give me some codes to demonstrate how to shuffle the Array[],please? And if I want to store the possible numbers in ArrayList, is there any difference?
    Thank you!
    Edited by: Terry001 on Apr 21, 2008 8:36 PM

  • Load Java classes location/path in the datbase

    Hi all,
    I have uploaded Java class file into the database using LOAD JAVA.
    Where i can see my sources or class file in the database home?
    I mean directory path for the java class?
    Thanks

    Kalee wrote:
    Is there a way to see java source(methods,variables etc) from database?If there is no java sources in DB (only class files were loaded), then unload classes and use a decompiler. For example, jad or jd.

  • Ant tools: converter java card -  class file  not belonging to the package!

    Hi
    I have another problem with converter. Could you help me please again if you have the time?
    I have created a directory when I save the class files generated by javac. After That , I use convert in this way:
    <convert
    JCA="true"
    EXP="true"
    CAP="true"
    packagename="testUn/classes/testUn"
    packageaid="0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x02:0x00"
    majorminorversion="1.0"
    verbose = "true">
    <AppletNameAID
    appletname="testUn.classes.testUn.PorteAppUn"
    aid="0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x02:0x00:0x00"/>
    <classpath refid="classpath"/>
    </convert>
    Here is the answer of the computer:
    [echo] Generation of the CAP,JCA and EXP files...
    [convert] Java Card Ant Tasks, Version 1.0
    [convert] Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    [convert] Note: Usage of Java Card Ant Tasks is optional. Java Card Ant Tasks are not supported by Sun Microsystems, Inc.
    [convert] Java Card 2.2.2 Class File Converter, Version 1.3
    [convert] Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    [convert] parsing /home/ehoudart/app-manager/VersionZero/src/testUn/classes/testUn/PorteAppUn.class
    [convert] converting testUn.PorteAppUn
    [*convert] error: class PorteAppUn does not belong to package testUn.classes.testUn.*
    [convert] conversion completed with 1 errors and 0 warnings.
    I do not understand why this unique applet class file does not belong to its own package. Is someone an idea?
    Thanks very much in advance for your answer.

    Here is a complete example build.xml (I think I have posted this before).
    <?xml version="1.0" encoding="UTF-8" ?>
    <project default="convert" name="javacard-starter">
      <!-- Build specific properties -->
      <property name="target.classes" location="${basedir}/target/classes" />
      <property name="target.javacard" location="${basedir}/target/javacard" />
      <property name="source.java" location="${basedir}/src/main/java" />
      <!-- Must point to the folder containing the JAR files from the JCDK -->
      <property name="javacard.libs" location="${basedir}/lib" />
      <!-- Must point to the folder containing the JAR file from the JCDK ant task -->
      <property name="javacard.ant-task" location="${basedir}/lib" />
      <!-- Must point to the folder containing the API export files from the JCDK -->
      <property name="javacard.export" location="${basedir}/src/main/export" />
      <property name="verbose" value="true" />
      <property name="noverify" value="false" />
      <!-- Path for JC tasks -->
      <path id="classpath">
        <fileset dir="${javacard.ant-task}">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${javacard.libs}">
          <include name="*.jar" />
        </fileset>
      </path>
      <!-- set the export path to the Java Card export files -->
      <path id="export" description="set the export file path">
        <fileset dir="${javacard.export}">
          <include name="**/*.exp" />
        </fileset>
        <pathelement path="${javacard.export}" />
        <pathelement path="${target.classes}" />
        <pathelement path="${target.javacard}" />
      </path>
      <!-- Definitions for tasks for Java Card tools -->
      <taskdef name="capgen" classname="com.sun.javacard.ant.tasks.CapgenTask" classpathref="classpath" />
      <taskdef name="deploycap" classname="com.sun.javacard.ant.tasks.DeployCapTask" classpathref="classpath" />
      <taskdef name="convert" classname="com.sun.javacard.ant.tasks.ConverterTask" classpathref="classpath" />
      <taskdef name="verifyexport" classname="com.sun.javacard.ant.tasks.VerifyExpTask" classpathref="classpath" />
      <taskdef name="verifycap" classname="com.sun.javacard.ant.tasks.VerifyCapTask" classpathref="classpath" />
      <taskdef name="verifyrevision" classname="com.sun.javacard.ant.tasks.VerifyRevTask" classpathref="classpath" />
      <typedef name="appletnameaid" classname="com.sun.javacard.ant.types.AppletNameAID" classpathref="classpath" />
      <typedef name="jcainputfile" classname="com.sun.javacard.ant.types.JCAInputFile" classpathref="classpath" />
      <target name="init">
        <mkdir dir="${target.classes}" />
        <mkdir dir="${target.javacard}" />
      </target>
      <target name="clean">
        <delete dir="${target.classes}" />
        <delete dir="${target.javacard}" />
        <delete dir="${javacard.eeprom}" />
      </target>
      <target name="compile" depends="init" description="Compile source code to class files">
        <!-- Compile the java code from ${src} to ${classes} -->
        <javac debug="yes" optimize="no" srcdir="${source.java}" destdir="${target.classes}" source="1.5" target="1.5">
          <classpath refid="classpath" />
        </javac>
      </target>
      <target name="convert" depends="compile" description="Convert class files to cap files">
              <convert packagename="chaining" packageaid="0xF0:0x00:0x00:0x01:0x00:0x01" majorminorversion="1.0" classdir="${target.classes}" outputdirectory="${target.classes}" jca="true" exp="true" cap="true" debug="true" verbose="${verbose}" noverify="${noverify}">
                   <appletnameaid aid="0xF0:0x00:0x00:0x01:0x00:0x01:0x00:0x01" appletname="chaining.ChainingApplet" />
                   <exportpath refid="export" />
                   <classpath refid="classpath" />
              </convert>
      </target>
      <target name="copy-debug">
        <mkdir dir="${target.debug}" />
        <echo>Copying cap files</echo>
        <copy flatten="true" todir="${target.debug}" verbose="true">
          <fileset dir="${target.classes}" includes="**/*.cap" />
          <fileset dir="${target.classes}" includes="**/*.exp" />
          <fileset dir="${target.classes}" includes="**/*.jca" />
        </copy>
      </target>
      <target name="all" depends="clean, convert" />
    </project>

  • Can not map .xsql to the java class name

    I am using IBMWebAS V2.0 with HTTP server V1.3.3, but I having problem mapping .xsql to the java servlet class oracle.xml.xsql.XSQLservlet. class path is properly defined in the bootstap.properties file but where can I need to put the codes for proper servlet passing with proper extention.

    I am using IBMWebAS V2.0 with HTTP server V1.3.3, but I having problem mapping .xsql to the java servlet class oracle.xml.xsql.XSQLservlet. class path is properly defined in the bootstap.properties file but where can I need to put the codes for proper servlet passing with proper extention.

  • Class Not found Exception for invoking BPEL process through the Java code

    Hi.
    The JDeveloper IDE raise the Exception From the invoking the BPEL process through the java code .Class Not Found Exception (Locator,ID.......).What is process of importing these classes from API.

    In your code (.bpel file) import the library using the bpelx:exec tag. For example the adding the following entry in your .bpel file imports the com.oracle.bpel.client.util library.
    <bpelx:exec import="com.oracle.bpel.client.util.*"/>

  • Tool to create Java Object classes using the Database Tables

    Hi,
    Is their any tools or utility available to create the Java Object Classes using the Database Tables as input.
    Lets Say I am having the Employee, Employee_Salary tables in the Database.The utility has to create the Java Object classes with the relation.
    Please Help...
    Thx..

    Hm, for generating regular Java classes I wouldn't know one from memory. But I suggest you start searching in for example the Eclipse marketspace for a third party plugin that can do it. If all fail, you could always use Hibernate Tools from the Jboss Tools Eclipse plugin set to generate Hibernate/JPA entities and then strip the annotations from them to turn them into regular POJO classes.
    How many tables are we talking about anyway? It might be less effort to just create the classes with properties and then use an IDE to generate getters and setters for them.

Maybe you are looking for

  • My copy of Photoshop still does not work properly, and support refuses to help me.

    From my previous thread: I can't actually get photoshop to go into the image editor. The program launches just fine, I can open up any dialogs such as preferences, but when I try to open something or start a new file, nothing happens. No error messag

  • Read-Only view object won't give me it's row

    Hi, I have a read only view object which when executed has one row in it, but the next method returns null. this is my code in the AM:     public Row getPerson() {         Row row = null;         ViewObject vo = getPersonsView1();         vo.setNamed

  • PI 7.0 SP15 to PI 7.1 EHP1

    Hello, Have a few queries. 1. Firstly, I see the EHP1 getting released to customers by end of august 09? am I correct? 2. Nextly, can an upgrade from PI7 SP15 to PI 7.1 EHP1 be done directly? or there needs to be some other upgrade that needs to happ

  • Final cut project to toast 11?

    How do I get my project from Final Cut Pro to Toast 11? Do I have to export it? If so, in what format? I am new to Toast and I can see all of my raw video clips but I cannot see a project. Please hel

  • Table Model:: Null Pointer Exception

    I have made an application wherein I am using a JTree to display some hierarchy. Now while scrolling the tree,I display the details in the table. Data for both the components come from the database.If I continously scroll up and down for some time in