How to read the Java source code (in Netbeans)

I use OS X10.5.5, NetBeans 6.1 and JSE 6 on a 64 bit mac.
When I downloaded NB6.1 it had JSE 5 as it's default (and only) java platform. I ran Software Update to get Java 6 from Apple, used the Java Prefrences utitlity to set JSE6 as default. In NB I added the JDK6 platform, registered the JDK6 javadocs and noticed that I also have the option of registering the Java source code.
I have three questions:
1) How do I make JDK6 the default in NetBeans. The JDK5 keeps being default after I did the steps above and I don't see anywhere to change that.
2) How do I read the Java 6 source code? I can see sun provides [source code| http://download.java.net/jdk6/] for their supported platforms. I dont see Apple doing the same for its JDK port. What would I need to do to get to read the java SE6 sources? or is it actually hiding somewhere in the /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home hierarchy?
3) Where does the JVM look for the binary code to run when I make a call to, say java.util.ArrayList or any other library. In my naivety I would have assumed it would be a .class file somewhere in the java Home folder, but I don't see anything like it.
thanks in advance,
chris

This is taken from the help included with netbeans. In response to question 1.
By default, the IDE uses the version of the Java SE platform (JDK) with which the IDE runs as the default Java platform
for compilation, execution, and debugging. You can view your IDE's JDK version by choosing Help > About and clicking the
Detail tab. The JDK version is listed in the Java field.
You can run the IDE with a different JDK version by starting the IDE with the --jdkhome jdk-home-dir switch on the command line
or in your IDE-HOME/etc/netbeans.conf file. For more information, see IDE Startup Parameters.
In the IDE, you can register multiple Java platforms and attach Javadoc and source code to each platform. For example, if you
want to work with the new features introduced in JDK 5.0, you would either run the IDE on JDK 5.0 or register JDK 5.0 as a
platform and attach the source code and Javadoc to the platform.
In  , you can switch the target JDK in the Project Properties dialog box. In  , you have to set the target JDK in the Ant script itself,
then specify the source/binary format in the Project Properties dialog box.
To register a new Java platform:
Choose Tools > Java Platforms from the main window.
Click New Platform and select the directory that contains the Java platform. Java platform directories are marked with a  
in the file chooser.
Use the Sources and Javadoc tabs to attach Javadoc documentation and source code for debugging to the platform.
Click Close.
To set the default Java platform for a standard project:
Right-click the project's root node in the Projects window and choose Properties.
In the Project Properties dialog box, select the Libraries node in the left pane.
Choose the desired Java platform in the Java Platform combo box.
Switching the target JDK for a standard project does the following:
Offers the new target JDK's classes for code completion.
If available, displays the target JDK's source code and Javadoc documentation.
Uses the target JDK's executables (javac and java) to compile and execute your application.
Compiles your source code against the target JDK's libraries.
If you want to register additional Java platforms with the IDE, you can do so by clicking the Manage Platforms button.
Then click the Add Platform button and navigate to the desired platform.
To set the target Java platform for a free-form project:
In your Ant script, set the target JDK as desired in the javac, java, and javadoc tasks.
Right-click the project's root node in the Projects window and choose Properties.
In the Sources panel, set the level of JDK you want your application to be run on in the Source/Binary Format combo box.
When you access Javadoc or source code for JDK classes, the IDE searches the Java platforms registered in the
Java Platform Manager for a platform with a matching version number. If no matching platform is found, the IDE's default platform is used instead.
See Also
Managing the Classpath
Declaring the Classpath in a Free-Form Project
Stepping Through Your Program
Legal Notices

Similar Messages

  • How to read the html source code of a webpage.

    How can I read the html source code of a webpage with a java application?
    Is there a good idea?

    >
    How can I read the html source code of a webpage
    with a java application?
    Is there a good idea?
    I don't know if this is a good idea, but it works.
    1) Use a URL to obtain the document's location
    2) Use a URLConnection to open a connection between your computer and the
    document server
    3) Connect to the server
    4) Get the InputStream of said connection
    5) Associate the Input Stream with a Buffered Input Stream
    At this point you can use a loop to read lines from the BufferedInput Stream and append them to a TextArea or other suitable text component.

  • How to Use the JAVA SCRIPT code in .htm page of the component

    Hi .
    In my requirement i have to use Java Script Function in .htm code ..how to use the java script code and functions in .htm???
    thank you
    B.Mani

    Check this document  [Arun's Blog|http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebClientUI-TalkingwithJava+Script]
    Regards
    Kavindra

  • How to get the HTML Source code from the active browser ?

    Hi All,
    I need to get the HTML Source code from the active browser (IE). I tried with the below code, but I am not able to get the Source code all the time, with respect to the different applications (http or https) and the user authentication has to be changes in few applications (_I dont know or not able to given that in the below code_). More over there is also a dependence of the URL to get the HTML Source code.
    Therefore what I feel is getting the HTML Source code from the given or active browser will be consistent than the URL. Since the Source code is available in the browser (IE) . Please help me with a sample code to achieve this . . . !
    HTMLDocument doc=(HTMLDocument) kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
    URL url = new URL(strURL);
    Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
    kit.read(HTMLReader, doc, 0);Thanks in advance,
    Regards,
    Jothi Venkatachalam
    Edited by: j0o on May 7, 2009 3:11 AM

    The simple answer is: you don't.
    Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
    You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
    For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols.

  • How to edit the html source code for my site

    I have just started a blog, and am VERY new to it. I am trying to edit the html source code on my site (ie, to insert google adsense search bars). I go to my blog site, get to page source and see the html but I am not able to edit it. Not sure what I am doing wrong. Thanks!

    You can use any editor you want mine is set up for notepad.exe
    :see http://dmcritchie.mvps.org/firefox/firefox.htm#notepad
    :to invoke use "Ctrl+U" or View > Page Source
    :this is for sites that you maintain on your local drives or servers, and copy over to a website.

  • How to understand the Vector source code for function elements()?

    hello all:
    This following code snippet is extracted from java.util.Vector source code.
    who can tell me how i can understand what the function nextElement does?
    thank you
    public Enumeration elements() {
         return new Enumeration() {
             int count = 0;
             public boolean hasMoreElements() {
              return count < this.num_elem;
             public Object nextElement() {
              synchronized (Vector.this) {   //???
                  if (count < elementCount) {//???
                   return elementData[count++];
              throw new NoSuchElementException("Vector Enumeration");
        }

    Perhaps code would help more. This codeimport java.util.Vector;
    import java.util.Enumeration;
    import java.util.Iterator;
    public class Test {
        public static void main(String[] arghs) {
         Vector v = new Vector();
         Integer two = new Integer(2);
         // Fill the Vector
         v.add("One");
         v.add(two);
         v.add(new StringBuffer("Three"));
         // Enumerate through the objects in the vector
         System.out.println("---- Enumeration ----");
         Enumeration e = v.elements();
         while (e.hasMoreElements()) System.out.println(e.nextElement());
         // Loop through the objects in the vector
         System.out.println("---- Loop ----");
         for (int i=0; i<v.size(); i++) System.out.println(v.get(i));
         // Iterate through the objects in the vector
         System.out.println("---- Iterator ----");
         Iterator i = v.iterator();
         while (i.hasNext()) System.out.println(i.next());
    }produces this output
    ---- Enumeration ----
    One
    2
    Three
    ---- Loop ----
    One
    2
    Three
    ---- Iterator ----
    One
    2
    Three
    So, for a Vector, all three do the same thing. However, Iterator is part of the Collection Framework (see [url http://java.sun.com/j2se/1.4.2/docs/guide/collections/index.html]here). This allows you to treat a whole bunch of [url http://java.sun.com/j2se/1.4.2/docs/guide/collections/reference.html]objects which implement the Collection interface all the same way. I know this is way more than you were asking, but I hope it at least clears up what you were asking.

  • How to read the java class file to convert it in java.

    hello all,
    i m developing the java application which generated the java code from the java 'class file' .
    Can anybody please help me, Is any java support for reading the class file? or how to know the class file format?
    I know the application javad, jad, javap which is doing the same thing.
    thanks for reply,
    - Jayd

    do you mean decompiling? there are tons of java decompilers available out there, what exactly are you trying to do here?

  • How to read the java analytical workspace object, when it is being rebuild?

    Hi is there any way to save the OLAP into java object, so that it can be read even though it is being rebuild?
    so when I rebuild the AW(analytical workspace), the other user still can read the old AW object while waiting the new AW object is build
    I even try to create 2 AW, while I create 1 AW I try to read another AW in the same database schema
    but then the reading process for the second AW is hang until the creation of the first AW is finish
    is there any way so that the process can happen simultaneously without waiting the building process is finished?

    A second user should be able to access an AW even while it is being built as long as the two users have different sessions - instances of OracleConnection in jdbc terms. It is not enough to use two Java Threads sharing the same connection.

  • How to load the JSP Source Code from Browser

    I have made a program using JSP ( one file ) and Java Beans ( 2 files ).
    The processed in those JavaBeans files and for output to Browser using JSP File.
    And I'm using JBuilder7 Software for building my applicaton.
    I already tested my source through JBuilder ( Applet Viewer ) and my source is running well but I got problem when to load that JSP file through Browser ( IE 6 ) with URL.
    Can anybody help me with this ?
    Best Regards,
    Yeppy S.

    I have made a program using JSP ( one file ) and Java Beans ( 2 files ).
    The processed in those JavaBeans files and for output to Browser using JSP File.
    And I'm using JBuilder7 Software for building my applicaton.
    I already tested my source through JBuilder ( Applet Viewer with TOMCAT Virtual Machine ) and my source is running well but I got problem when to load that JSP file through Browser ( IE 6 ) with URL.
    I put my source at F:\Source\Kiosk9 and my JSP file at F:\Source\KiosK9\defaultroot.
    And the JavaBeans Files at F:\Source\KiosK9\src\kiosk9.
    And the name of the package is kiosk9.
    My structure directory :
    F:\Source\KiosK9
    F:\Source\KiosK9\bak
    F:\Source\KiosK9\classess
    F:\Source\KiosK9\defaultroot
    F:\Source\KiosK9\src
    F:\Source\KiosK9\tomcat
    This directory structure was made automatically by JBuilder7 ( F:\JBuilder7 ).
    URL : http:\\localhost:8080\defaultroot\KiosK9Jsp.jsp
    And the error is :
    "Socket Error
    Connection refused by Remote Host"
    Can anybody help me with this ?
    Best Regards,
    Yeppy S.

  • How to Read the one Source Column data and Display the Results

    Hi All,
         I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results
    Ex:
    Pr_ProjectType
    AD,AM
    AD
    AM
    AD,AM,TS,CS.OT,TS
    AD,AM          
    like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need
    4.AD,AM,TS,CS.OT,TS in this string we need AD,AM  only.
    this logic we need we have thousand of data in the table.Please help this is urgent issue
    vasu

    Hi Vasu,
    Based on your description, you want to eliminate the substrings (eliminated by comma) that are not AD or AM in each value of the column. Personally, I don’t think this can be done by just using an expression in the Derived Column. To achieve your goal, here
    are two approaches for your reference:
    Method 1: On the query level. Replace the target substrings with different integer characters, and create a function to eliminate non-numeric characters, then replace the integer characters with the corresponding substrings. The statements
    for the custom function is as follows:
    CREATE FUNCTION dbo.udf_GetNumeric
    (@strAlphaNumeric VARCHAR(256))
    RETURNS VARCHAR(256)
    AS
    BEGIN
    DECLARE @intAlpha INT
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
    BEGIN
    WHILE @intAlpha > 0
    BEGIN
    SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
    END
    END
    RETURN ISNULL(@strAlphaNumeric,0)
    END
    GO
    The SQL commands used in the OLE DB Source is like:
    SELECT
    ID, REPLACE(REPLACE(REPLACE(REPLACE(dbo.udf_GetNumeric(REPLACE(REPLACE(REPLACE(REPLACE([ProjectType],'AD,',1),'AM,',2),'AD',3),'AM',4)),4,'AM'),3,'AD'),2,'AM,'),1,'AD,')
    FROM MyTable
    Method 2: Using a Script Component. Add a Derived Column Transform to replace the target substrings as method 1, use Regex in script to remove all non-numeric characters from the string, add another Derived Column to replace the integer
    characters to the corresponding substring. The script is as follows:
    using System.Text.RegularExpressions;
    Row.OutProjectType= Regex.Replace(Row.ProjectType, "[^.0-9]", "");
    References:
    http://blog.sqlauthority.com/2008/10/14/sql-server-get-numeric-value-from-alpha-numeric-string-udf-for-get-numeric-numbers-only/ 
    http://labs.kaliko.com/2009/09/c-remove-all-non-numeric-characters.html 
    Regards,
    Mike Yin
    TechNet Community Support

  • How to save the user-defined Java source code

    Would you please tell me how to download all of the java source code in one software component.

    UDFs can be exported one by one as a .mte file...not at one go...

  • How to generate the Cobol Source part of the ApplicationViewer

    Hello,
    I'm actually generate the Cobol Source part of the application viewer on a windows environment.
    I'm trying to build it from a Unix environment but I don't know how because I doesn't find the same script in Unix I use in windows.
    Can someone tell me how to generate the Cobol Source part of the application Viewer please ?
    Thank you in advance.

    >
    How can I read the html source code of a webpage
    with a java application?
    Is there a good idea?
    I don't know if this is a good idea, but it works.
    1) Use a URL to obtain the document's location
    2) Use a URLConnection to open a connection between your computer and the
    document server
    3) Connect to the server
    4) Get the InputStream of said connection
    5) Associate the Input Stream with a Buffered Input Stream
    At this point you can use a loop to read lines from the BufferedInput Stream and append them to a TextArea or other suitable text component.

  • Issue of Security about Java Source Code

    At most time Java compiler compiles the *.java source code into *.class files and then pack them in *.jar files running in the Java VM or as applet running on web pages.
    Recently I find a tool named cavaj that can decompile *.class files into *.java files. I tried it to decompile my *.class files and unvealed that the decompiled *.java files are the same of my source code!
    How to protect the source code not to be pirated? This is a big problem about the mechanism of Java. Is there any tool to compile *.java to *.exe files? Or is there any tool that can decompile *.exe to *.java in the future?

    This is a common question. If you do a search you will find many answers/solutions.
    But can it affect the performance of the program? Your program mayload slight faster, but the runtime performance is the same. It may effect your performance as it takes some time to get the obsufaction right, especially if you are using reflection.

  • How to access the *.java file corresponding to a TypeElement T?

    Here is a problem:
    How to access the *.java file corresponding to a TypeElement T from a AnnotationProcessor environment?
    Let us say the hook method
    public boolean process(Set<? extends TypeElement> annos, RoundEnvironment roundEnv)
    is invoked with a TypeElement T such that T.getQualifiedname() = "a.b.c.X"
    And the problem is how to locate the file that has the *.java source code for a.b.c.X?
    That is the file that has the source code for a.b.c.X say "some/path/a/b/c/X.java"?
    For simplicity, let us assume that TypeElement T corresponds to a top-level Java class.

    Pinaki wrote:
    That is not something you as the annotation processor author should be asking about. That is something you the person configuring the javac environment should set up via the -d option or its equivalent.
    I strongly recommend using a separate output directory hierarchy.That is the way the current implementation is. The annotation processor takes a -Aout= <some directory path> to write generated output relative to a user-specified location (which defaults to the class output location).That is contrary to the design of the annotation processing facility. The intended use is for that information to be configured via options like "javac -d".
    Additionally, IMO it is a serious configuration error to put generated files and input files, presumably tracked under version control, in the same directory. Interesting you said that. We are just running some "field trial" with these things and some users want them to be in the same directory of the original *.java files (especially when their source files are spread across many roots) .
    Who knows what the user wants?The user does and the user is free to (mis)configure their environment however they like ;-) However, that is the user's option and the user has control of this via the javac command line. The annotation processor is not the proper place to configure this setting; see slide 7 of http://blogs.sun.com/darcy/resource/J1_2006-BOF-0606.pdf for some thoughts on different roles in annotation processing.
    presumably tracked under version control, in the same directory.version control is another 'usability issues' that we are trying to get our heads around with this stuff. "To check-in or not?" - that seems to be the question. When presented these facilities without any cue, "the users" were divided -- some wanted them to be checked-in, some did not. The context where these generated files being used -- there exists some rationale to check them in a version control system.The right answer depends on the circumstances, but IMO generally generated files should not be checked in under version control, especially if they are derived from other source files. Checking in generated files of this nature just creates the opportunity for them to get out of date with the originating files.

  • Java source code to compare XML based on ExamXML XML diff tool

    I&#8217;m working on a project that includes comparing XML files and I need a source code on Java to compare XML fragments.
    I&#8217;m using ExamXML from http://www.a7soft.com to compare XML files but I need the Java source code.
    Can anybody help me.

    You didn't notice there's a "Support" link on that page you referred to? Ask them for the source code. If they won't give it to you, then you are effectively asking us to give you a stolen copy of it. Don't ask for such things on this site.

Maybe you are looking for

  • Ipod shuffle will NOT keep music - only one CD downloaded - HELP!?

    WELL, it lets me add songs (supposedly) to the ipod. ONE of the cd's I purchased actually copied to the ipod. It says it's syncing, and it adds the other cd's to the library. But every time i eject the ipod and listen to it - only that one cd is ther

  • Import JSPs from one project to another (depends on or ??)

    I'd like to solve the large product problem: Broke up into several projects. The problem is most evident in unit testing with the internal container. Any jsp includes or forwards to JSP's in other projects just is not supported with local testing. I'

  • AppleTV only gets clear picture on HDMI 1, HDMI 2 and 3 are dull pictures

    My new AppleTV works fine but only in HDMI 1. Both HDMI 2 and 3 are a very dull picture. I've got a Panasonic 42" plasma. TV looks dull when plugged into HDMI 2 and 3 also. What am I missing? I couldn't have 2 bad inputs could I? Your help is appreci

  • Do you want save the changes

    Hi, I have an item in a block with when_new_item_instance trigger, which is to clear the entire form. but when i make changes in other block and coming back to this item it forces to save the changes. but i dont want to save the changes , so how coul

  • Proportional factors

    Hi Experts forecast model at product family level in APO DP. Quantity balance of history data between #A and #B was almost 50%:50%, but STAT is 0%:100%... by automatically batch job run. confusing symptom is when i run STAT by manually, the STAT is 5