Distributing classes over various source files

Hi,
Here are my 2 newbie java questions about :
1) is it possible to split a single class up among several files,? I�ve tried taking my file foo.java and splitting it so that half the methods are in foo1.java and the other half are in foo2.java, just for convinience and readablity. Javac doesn't seem to like this. Is there something I shoudl be doing to make this legal or is it just not allowed?
2) Similarly, is there a way have a private inner class in a seperate file from its outer class?
I haven�t seen any references to how to do this � is it that javac is very dependant on the structure of the .java files, or just that all the examples I�ve seen so far have been?
Thanks,
Dan

1) is it possible to split a single class up among several files,? Yes, but you'll have to glue them all back together again to get javac to process them.
I�ve tried taking my file foo.java
and splitting it so that half the methods are in foo1.java and the other half are in foo2.java,
just for convinience and readablity. Convinience : doesn't seem very convenient to me to have one class split into two source files.
Readability: as above, less readable.
If your class seems incovenient or unreadable, its most likely too big and doing too many things.
Javac doesn't seem to like this. Is there something I
shoudl be doing to make this legal or is it just not allowed?Glueing the pieces back together.
2) Similarly, is there a way have a private inner class in a seperate file from its outer class?Not without some preprocessor goo.
is it that javac is very dependant on the structure of the .java filesMost likely by design.

Similar Messages

  • Why only one public class in a source file?

    why we have to write only one public class in a source file?

    PhHein wrote:
    Because the JLS says so.It does?
    From section 7.6 of the JLS (third edition):
    When packages are stored in a file system (§7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:* The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    >
    To my mind, it's strongly recommending, rather than mandating, this practice. All academic of course, merely shifting the answer from "Because the JLS says so" to "Because pretty much all Java compilers say so". I don't know of any that don't enforce this, but of course, that doesn't mean they don't exist

  • Can you code 2 classes into one source file?

    Can you have 2 classes coded in one source file? If so, do you end up with 2 .class files after the compile?

    yes you can code 2 classes in one source file. I
    believe that you have to reference one class is an
    "object" class of the class under which you save the
    file as.
    Example:
    File name is A.java
    class A{
    class B{
    When you want to refer to class B, you have to say
    A.B ( eg: A.B ab = new A.B() ). The class file(s)
    will be A.class and A$B.class.
    This is what I recall at best at the time. good luckI presume you mean when one is an inner class? Otherwise:
    public class one {
      one() { System.out.println("one");
      public static void main( String[] argv ) {
        new one();
        new two();
    class two {
      two() { System.out.println("two");
    }Will work fine, and will create one.class and two.class. But that does not mean it is a good idea to do it ;o)

  • Add class without a source file in Jbuilder

    I have a project with 10 classes. I have been given the source files of the seven of them and the final three class files of the rest. The thing is that when I am trying to compile one of the seven source files which need the already made class files they cannot be compiled because they cannot find the 3 class files.
    I am using jbuilder 5 and it is a servlet project.I read somewhere that I have to add too the 3 class files in the libraries that the project uses?Is this correct and how can i do it?
    It is not just enough to add the class files in the project?
    thanks....

    This may work...
    Take a look at 'Project/Project properties', which will bring up a dialog box, containing 'paths' tab. Under this click on 'required libraries', then 'add', and then 'new' then add the directory of your class files. If this doesn't work, add the classes to a jar and add the jar to your required library path.
    Hope this works, post back if not
    Matt

  • Differences between various source files in mdm import manager

    Hi,
    Can anyone tell me the differences between the source files(access,xml,xml schema,excel) available in mdm import manager?
    Thanks and regards,
    Rithesh
    Edited by: rithesh_shet on Mar 30, 2010 1:04 PM

    Hi Ritesh,
    MDM Import Manager provides flexibility to Import Data from different types of Sources into MDM.
    You can import data into MDM from below mentioned sources using Import Manager:
    1. From Files (Access, Delimited Text, Excel, Fixed Text, XML and XML Schema)
    2. Directly from Data base source (SQL server and oracle)
    As mentioned by Mandeep, XML Schema is something which you define in MDM console in advance. and then later select the Data source XML file and XML schema from drop down list (it will show all schema defined in console ) to validate XML source file against the XML schema.
    For automated Import, Ports are used. Ports are nothing but a logical point of contact with other systems i.e. other systems or middleware will drop file on the port for authomatic import and MDM import server will scan the port directory and if file is present then will import data automatically from file into MDM using a predefine Import Map. (this map needs to be defined manually in import manager and then assigned to port using console).
    Please check page no 45 of import manager reference guide for more details about various source properties of Import Manager.  (*link for import manager reference guide is already provided on the earlier post)
    Also check, page no 53 to 64 for how to import process. Kindly revert if you have any query.
    Regards,
    Shiv

  • Why we can have only one public class in one source file

    why we can have only one public class in one source file

    When the java compiler is run it looks for classes referenced by the classes you are directly compiling. When looking for these referenced classes it looks for source as well as class files and compiles them automatically if the coresponding class files are missing, or older than the source.
    In order to do this it must be able to work out the source file name for any given class which might be referenced from another (the rule also applies to package level access).

  • Two public classes in one source file

    Can anyone please explain what is the exact reason why the java source file name should be same as the only allowed public class name in the source file. Answer only if you know the correct answer. No gusses please. I read the other postings on this topic. None of the answers were correct.

    One reason is that some RISC processor architectures
    (like those Sun uses mostly) have hierarchical memory
    architectures. This hierarchy is divided into global
    modules and local (global-accessible) submodules. The
    advantage of this is that the processor needs lesser
    memory access "points" (handles), as the modules
    delegate CPU calls to the submodules.
    The java compiler can utilize this and increase
    performance by loading the entire source files into
    the memory and assign them a CPU handle (the module
    ID). It'll be later used for linking, e.g. The public
    class in a file will be loaded as a module and gets
    the handle, all other non-public classes in that file
    will be submodules.
    If there is no public class, a generic module will be
    used, so that's no problem. But if there are multiple
    public classes, you'd end up with several modules and
    just one handle to assign, thus having ambiguity. The
    CPU won't be able to address the correct module.
    This all only applies to RISC CPUs, but for obviuos
    cross-platform compatibility reasons it was added to
    the standard - it doesn't hurt the other
    architectures, but helps those with hierarchical
    memory management.Thanks, but the rooster explanation makes more sense to me.
    Now could someone please express it a la Majinda?

  • Can you place more than one class in a source file?

    If so how is this done because I get the following error when I try to.
    IPHunter.java:100: class Arguments is public, should be declared in a file named Arguments.java
    public class Arguments {
    Thanks in advance

    When having two classes in the same file, only one should be public, and the file should be named with the name of that class.
    Try removing public from the class Arguments, and if you have to use it from classes outside the file, you should have a file Arguments.java
    Hope that helps,
    Al

  • Does a member class have to be within the same source file?

    Hi there,
    I have this application that extensively uses two classes. The main class setsup the GUI, and the second main class is responsible for handling all of the actions that arise from the GUI.
    I could have done this by making all of my handler methods be of the first main class, but this class really is just for the GUI setup, the logic doesn't fit into this class' behaviour.
    The class that handles the GUI actions is required to use the fields of the main class e.g. to get values of a text field. The problem is that since the class that handles the actions is getting very big, I would kind of like to move this class into a different source file - because currently it is a member class of the first one, so that it can access all of its fields.
    Is there some way that I can move this handler class into another source file, and still have it access all of the fields of the main GUI class - without making the fields public, or using millions of get/set methods? Also, I can't use inheritance because the both the GUI class creates an instance of the handler class in its constructor, and so leads to an infinite loop when trying to instantiate the GUI class.
    Can I ask.. would a static class or something be of use here? Do they exist? I'm confused as to how to do this without getting the mother of all source files (in size that is - nothing to do with cooking or baking).
    - Anyway, thanks in advance for any help that you could give me -
    BYEE, Edd.

    You can't have an inner class that is not in the same source file. However, you could use package-protected (default) access to give another class in the same package access to things without making them public. Actually, that's how inner classes are actually compiled. Package-protected access is underused IMHO. It's a great tool that most people (including myself) are suspicious of at first.

  • FLEX debugger not hitting breakpoints, because Flash sometimes embeds source file paths with wrong letter case?

    I was trying to figure out why breakpoints were working fine for source files in some locations but not others.  FlashDevelop's debugger (which I believe is actually the FLEXSDK debugger) was successfully connecting, tracing output, and hitting breakpoints in SOME files, but not others.
    I downloaded SWFInvestigator from Adobe Labs and checked the embedded debug paths for various source files to see what was going on.
    I discovered that files in which no breakpoints could be hit had their paths embedded in all lowercase (e.g. "c:\users\username\desktop\source\myproject" instead of "C:\Users\username\Desktop\source\MyProject").
    So I have two questions:
    First, is this a Flex debugger issue, or a FlashDevelop plugin issue? Letter case shouldn't matter or interfere with matching file paths in Windows.
    Second, what could possibly influence the letter case of embedded paths in a SWF output by Flash Professional (CS6), such that they are sometimes all lowercase and other times maintain the same case from the file system?  And why would that affect a debuggers ability to hit breakpoints in Windows 7?  I am compiling in multiple ways. Sometimes clicking Publish within Flash. Sometimes the file being published is not even open in Flash, and my JSFL script file is passed to Flash.exe containing embedded file paths to open the document. Usually, everything seems to work fine, no matter where I publish from, regardless of whether the FLA file is open or not. I'm honestly starting to believe that it depends on how the FLA was last opened in Flash Professional, as though it saves some sort of last access path internally and uses that to embed debug information.

    I don't think it's the source path in my case, because it's simply the dot ".", although I did check that because it would most likely influence the embedded paths.
    In the library path, I use relative paths exclusively, since all my individual project folders exist in the same "source" folder.
    Here's how I arrived at the conclusion that something more complex or "stateful" must be occuring:
    I publish my files with a one-click application, which does the following
    updates version timestamps (static constants) in specific files via regex match
    fills in a JSFL template with the FLA filename and writes the JSFL file to disk, then passes the JSFL file path to flash.exe for publication
    the JSFL then runs a command, which signals the main application via cross-process communication that the script has finished publishing
    That all makes it easy for me to update and publish multiple projects and deploy them, with a single click.  Here is the JSFL template I created, which has been drastically simplified since the days where it used to search to see if the file was open in Flash, select the document, and call publish.  Now it just uses the publishDocument method to silently publish files without opening them.
    var filepath = "FLAFILEPATH"; //template parameter: the URI (beginning with "file:///") of the FLA file to publish
    fl.publishDocument( filepath, "PUBLISHPROFILENAME" );
    FLfile.runCommandLine("COMPLETECOMMAND");
    The C# app replaces the strings in all caps with the actual values.  The COMPLETECOMMAND is actually populated with the application's own executable path, along with a "complete" switch, which lauches a 2nd instance, which handles the complete switch by broadcasting a signal over an interprocess channel and then terminates.  The main instance captures the signal, triggers a wait handle, and continues with publishing the next file.  Here is the core code for it:
    private string fillTemplate( string fla_directory, string fla_filename, string publish_profile_name )
        string fileuri = "file:///" + Path.Combine( fla_directory, fla_filename ).Replace( '\\','/' );
        return EmbeddedResources.OpenAndPublish //JSFL template file embedded as string resource
            .Replace( "FLAFILEPATH", HttpUtility.JavaScriptStringEncode( fileuri ) )
            .Replace("COMPLETECOMMAND", HttpUtility.JavaScriptStringEncode( "\"" + Application.ExecutablePath + "\"" + " -publishcomplete" )) //call self with -publishcomplete switch to signal main instance's publishCompleteSignal
            .Replace("PUBLISHPROFILENAME", HttpUtility.JavaScriptStringEncode( publish_profile_name ) );
    private static readonly string FLASH_PATH = @"C:\Program Files (x86)\Adobe\Adobe Flash CS6\Flash.exe";
    public void publish( string fla_directory, string fla_filename, string publish_profile_name )
        Program.publishCompleteSignal.Reset();
        string template = fillTemplate( fla_directory, fla_filename, publish_profile_name );
        string curdir = Environment.CurrentDirectory;
        string tempJSFLfilepath = Path.Combine( curdir, "temp_script.jsfl" );
        File.WriteAllText( tempJSFLfilepath, template );
        Process p = Process.Start( FLASH_PATH, tempJSFLfilepath );
        Program.publishCompleteSignal.WaitOne( 30000 ); //timeout after 30 seconds
    Here's where it gets interesting.  The FLAFILEPATH has ALWAYS been passed in as all lower case, yet this publication method has worked 99% of the time for hundreds of publish operations every day.  This applies to both the publication of the first SWC, which is referenced by the second published SWF (both were being published with lowercase paths), yet the paths for the main SWF were remaining in lowercase, while those in the referenced SWC were maintaining the correct case from the file system.
    So there may be any number of things going on here.  SWCs may be published differently than SWFs, such that SWCs always have the correct letter case for debug source files, regardless of how the source FLA project was opened.  Ensuring the path passed to publishDocument uses the right case definitely fixes the problem, but it doesn't explain why it usually worked, despite having always been passing a lowercase string.  The only variable I can think of in all of this is Windows itself or Flash, such as whether the document was open in Flash at the time the silent JSLF publishDocument command ran, and how that FLA was last opened (via shortcut, via "recent documents" in Flash, via recent documents in Windows.  It has to be something, even if it's something as obscure as how the folder path was last accessed in windows, although I strongly suspect it's just how (in terms of path case) the FLA was last opened in Flash.
    In any case, I'm happy that passing the right case to JSLF's publishDocument command fixes the problem, so I'm not going to spend any more time trying to figure out how opening the FLA in various ways could affect the embedded debug paths.  The only thing that should be done is to address how paths with the wrong case are handled when they do get embedded that way for whatever reason.  Perhaps the flex debugger should be updated to use case-insensitive matches in case-insensitive file systems, unless, perhaps, this is a FlashDevelop debugger issue after all.

  • Sun Studio 12 IDE doesn't allow me to edit the C++ source files...

    I installed Sun Studio 12 on my PC:
    SunOS version 5.10 running on x86
    Java 1.5.0_16
    I created a shared library project but I can't properly edit the source files. I can't scroll up/down or right/left over the source files. I would appreciate very much if somebody could support me with that.
    Thanks and regards,
    Ioan

    Hi Gordon,
    First of all thanks for your prompt answer. Now let's go back to my problem :-) - I tried removing the folder you indicated me but there was no change...:-(. Please find below the log file you asked for:
    Log Session: Saturday, August 30, 2008 3:16:22 PM EEST
    System Info: Product Version = Sun Studio (Build 200704122300)
    Operating System = SunOS version 5.10 running on x86
    Java; VM; Vendor; Home = 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-b02; Sun Microsystems Inc.; /usr/jdk/instances/jdk1.5.0/jre
    System Locale; Encoding = en (sunstudio); ISO646-US
    Home Dir.; Current Dir. = /export/home/ioanp; /export/home/ioanp
    Installation; User Dir. = /opt/netbeans-5.5.1/nb5.5:/opt/netbeans-5.5.1/ide7:/opt/netbeans-5.5.1/harness:/opt/netbeans-5.5.1/cnd1:/opt/SUNWspro/atd1:/opt/SUNWspro/prod:/opt/netbeans-5.5.1/platform6; /export/home/ioanp/.sunstudio/12.0-SunOS-i386
    Boot & Ext. Classpath = /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/i18n.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/sunrsasign.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/jsse.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/jce.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/charsets.jar:/usr/jdk/instances/jdk1.5.0/jre/classes:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/dnsns.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/localedata.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/sunjce_provider.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/sunpkcs11.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jhall.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jmf.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jmplay.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/mediaplayer.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/multiplayer.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jai_codec.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jai_core.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/mlibwrapper_jai.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/clibwrapper_jiio.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jai_imageio.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jmfmp3.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/mp3plugin.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/gnome-java-bridge.jar
    Application Classpath = /opt/netbeans-5.5.1/platform6/lib/boot.jar:/opt/netbeans-5.5.1/platform6/lib/org-openide-modules.jar:/opt/netbeans-5.5.1/platform6/lib/org-openide-util.jar:/opt/netbeans-5.5.1/platform6/lib/locale/boot_ja.jar:/opt/netbeans-5.5.1/platform6/lib/locale/boot_pt_BR.jar:/opt/netbeans-5.5.1/platform6/lib/locale/boot_zh_CN.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-modules_ja.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-modules_pt_BR.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-modules_zh_CN.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-util_ja.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-util_pt_BR.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-util_zh_CN.jar:/opt/netbeans-5.5.1/platform6/lib/locale/swing-l10n_pt_BR.jar
    Startup Classpath = /opt/netbeans-5.5.1/platform6/core/core.jar:/opt/netbeans-5.5.1/platform6/core/org-openide-filesystems.jar:/opt/netbeans-5.5.1/platform6/core/locale/core_pt_BR.jar:/opt/netbeans-5.5.1/platform6/core/locale/core_zh_CN.jar:/opt/netbeans-5.5.1/platform6/core/locale/org-openide-filesystems_ja.jar:/opt/netbeans-5.5.1/platform6/core/locale/org-openide-filesystems_pt_BR.jar:/opt/netbeans-5.5.1/platform6/core/locale/org-openide-filesystems_zh_CN.jar:/opt/netbeans-5.5.1/platform6/core/locale/core_ja.jar:/opt/netbeans-5.5.1/nb5.5/core/org-netbeans-upgrader.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb_ja.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb_pt_BR.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb_zh_CN.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/org-netbeans-upgrader_ja.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/org-netbeans-upgrader_pt_BR.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/org-netbeans-upgrader_zh_CN.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb.jar:/opt/netbeans-5.5.1/ide7/core/org-netbeans-modules-utilities-cli.jar:/opt/SUNWspro/prod/atd1/core/locale/core_sunstudio.jar
    Turning on modules:
         org.openide.util [6.8.31 200704122300]
         org.openide.modules [6.5.31 200704122300]
         org.openide.awt [6.7.31 200704122300]
         org.openide.filesystems [6.4.31 200704122300]
         org.openide.dialogs [6.5.31 200704122300]
         org.openide.nodes [6.7.31 200704122300]
         org.openide.windows [6.5.31 200704122300]
         org.openide.options [6.4.31 200704122300]
         org.openide.text [6.9.32 200704122300]
         org.openide.explorer [6.5.31 1 200704122300]
         org.openide.actions [6.5.31 200704122300]
         org.openide.loaders [5.9.31 200704122300]
         org.netbeans.api.xml/1 [1.13.30 200704122300]
         org.netbeans.spi.navigator/1 [1.2.31 200704122300]
         org.openide.io [1.9.31 200704122300]
         org.netbeans.core.output2/1 [1.7.31.1 1 200704122300]
         org.netbeans.modules.xml.core/2 [1.12.30.4 4 200704122300]
         org.netbeans.bootstrap/1 [2.3.31 200704122300]
         org.netbeans.core.startup/1 [1.5.31 200704122300]
         org.netbeans.swing.plaf [1.5.31 200704122300]
         org.netbeans.core/2 [3.2.31.1 200704122300]
         org.netbeans.libs.xerces/1 [1.8.32 2.8.0 200704122300]
         org.netbeans.modules.xml.tax/2 [1.12.30.4.4 4 200704122300]
         org.openide.execution [1.8.31 200704122300]
         org.netbeans.api.java/1 [1.10.31 200704122300]
         org.netbeans.modules.editor.util/1 [1.8.31 200704122300]
         org.netbeans.modules.editor.mimelookup/1 [1.3.31 200704122300]
         org.netbeans.modules.editor.fold/1 [1.5.31 200704122300]
         org.netbeans.modules.editor.lib/1 [1.9.31.1 1 200704122300]
         org.netbeans.modules.editor.plain.lib/1 [1.3.31 200704122300]
         org.netbeans.modules.queries/1 [1.7.31 200704122300]
         org.openidex.util/3 [3.9.32 200704122300]
         org.netbeans.modules.editor.settings/1 [1.4.31 200704122300]
         org.netbeans.modules.editor/3 [1.26.31.1 200704122300]
         org.netbeans.modules.editor.plain/1 [1.3.31 200704122300]
         org.netbeans.core.ui/1 [1.9.31 200704122300]
         org.netbeans.modules.settings/1 [1.10.51 200704122300]
         org.netbeans.modules.projectapi/1 [1.9.31 200704122300]
         org.netbeans.modules.cnd.api.model/1 [1.1.1 1 070814]
         org.jdesktop.layout/1 [1.3.41 1.0 200704122300]
         org.netbeans.api.progress/1 [1.5.31 200704122300]
         org.netbeans.libs.formlayout/1 [1.2.31 1 200704122300]
         org.netbeans.modules.options.api/0 [1.3.31 200704122300]
         org.netbeans.modules.cnd/1 [1.1.1 1 070814]
         org.netbeans.modules.projectuiapi/1 [1.13.32.5 5 200704122300]
         org.netbeans.modules.project.ant/1 [1.12.31 200704122300]
         org.netbeans.modules.cnd.makeproject/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.discovery [1.1.1 070814]
         org.netbeans.modules.cnd.modeldiscovery [1.1.1 070814]
         org.netbeans.modules.javahelp/1 [2.8.31 200704122300]
         org.netbeans.modules.diff/1 [1.15.31.42 42 200704122300]
         org.netbeans.modules.editor.errorstripe.api/1 [2.2.31.1 1 200704122300]
         org.netbeans.modules.editor.errorstripe/2 [2.2.31.1.1 1 200704122300]
         org.netbeans.modules.versioning/1 [1.3.31.1 1 200704122300]
         org.netbeans.lib.cvsclient/1 [1.14.31 200704122300]
         org.netbeans.modules.masterfs/1 [1.8.33 200704122300]
         org.netbeans.core.execution/1 [1.9.31 200704122300]
         org.apache.tools.ant.module/3 [3.24.31.1 1 200704122300]
         org.netbeans.libs.jsch/1 [1.4.31 0.1.24 200704122300]
         org.netbeans.modules.versioning.system.cvss/1 [1.7.31.1.42.1 1 200704122300]
         org.netbeans.modules.cnd.modelutil/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.qnavigator/1 [1.1.1 070814]
         org.netbeans.modules.cnd.antlr [2.7.5 070814]
         org.netbeans.modules.cnd.repository.api/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.apt [1.1.1 1 070814]
         org.netbeans.modules.cnd.dwarfdump [1.1.1 070814]
         org.netbeans.modules.xml.xam/1 [1.1.30 1 200704122300]
         org.netbeans.modules.favorites/1 [1.11.41 200704122300]
         org.apache.xml.resolver [1.1.30 1.1 200704122300]
         org.netbeans.modules.xml.catalog/2 [1.11.30.4.4 4 200704122300]
         org.netbeans.modules.projectui [1.9.10.5 200704122300]
         org.netbeans.modules.editor.bookmarks/1 [1.3.31 200704122300]
         com.sun.tools.swdev.advtools.actions.api [1.1.1 070730]
         org.netbeans.modules.cnd.folding [1.1.1 1 070814]
         org.netbeans.tasklistapi/1 [1.20.31.7 7 200704122300]
         org.netbeans.modules.tasklist.core/2 [1.37.31.16.7 16 200704122300]
         org.netbeans.modules.suggestions_framework/2 [1.15.31.9.16.7 9 200704122300]
         org.netbeans.modules.tasklist.docscan/2 [1.23.31.9.16.7 200704122300]
         org.netbeans.modules.ant.grammar/1 [1.14.31 200704122300]
         org.netbeans.modules.cnd.dwarfdiscovery [1.1.1 070814]
         org.netbeans.modules.cnd.highlight [1.1.1 070814]
         org.netbeans.lib.terminalemulator [1.3.1 070814]
         com.sun.tools.swdev.sunstudio.update/1 [1.1.1 070730]
         org.netbeans.modules.servletapi/1 [1.10.30 200704122300]
         org.netbeans.modules.editor.completion/1 [1.6.31 200704122300]
         org.netbeans.spi.palette/1 [1.6.10 200704122300]
         org.netbeans.modules.cnd.model.services/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.completion/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.gotodeclaration [1.1.1 070814]
         org.netbeans.modules.xml.schema.model/1 [1.1.30 1 200704122300]
         org.netbeans.modules.xml.wsdl.model/1 [1.1.30 1 200704122300]
         org.netbeans.modules.editor.codetemplates/1 [1.2.31 200704122300]
         org.netbeans.modules.cnd.modelimpl/1 [1.1.1 1 070814]
         org.netbeans.modules.css/2 [1.12.30 200704122300]
         org.netbeans.modules.image/1 [1.17.31 200704122300]
         org.netbeans.modules.editor.structure/1 [1.12.30.1 1 200704122300]
         org.netbeans.modules.xml.text/2 [1.12.30.4.4 4 200704122300]
         org.netbeans.modules.xml.retriever/1 [1.0.20 200704122300]
         org.netbeans.modules.cnd.classview/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.modelui [1.1.1 070814]
         org.netbeans.modules.utilities/1 [1.21.32 200704122300]
         org.netbeans.modules.utilities.project/1 [1.5.33 200704122300]
         org.netbeans.swing.tabcontrol [1.6.31 200704122300]
         org.netbeans.core.windows/2 [2.7.31.1 200704122300]
         org.netbeans.modules.httpserver/2 [2.6.30.42 42 200704122300]
         org.netbeans.modules.xsl/1 [1.12.30.4 200704122300]
         org.openide.src [1.8.31 200704122300]
         org.netbeans.modules.xml.tools/2 [1.12.30.4.4.4 4 200704122300]
         com.sun.tools.swdev.toolscommon [1.16.0.2 ${bm.build.name} ${bm.build.date}]
         com.sun.tools.swdev.sunstudio/1 [1.1.1 070730]
         org.netbeans.spi.viewmodel/2 [1.9.31 200704122300]
         org.netbeans.api.debugger/1 [1.7.33 200704122300]
         org.netbeans.spi.debugger.ui/1 [2.8.33 200704122300]
         com.sun.tools.swdev.advtools.actions.spi [1.1.1 070730]
         com.sun.tools.debugger.dbxgui/3 [3.0.0.2 FCS 2007/08/06]
         org.netbeans.modules.html.editor.lib/1 [1.5.30 200704122300]
         org.netbeans.modules.html.editor/1 [1.5.30 200704122300]
         org.netbeans.modules.properties/1 [1.17.31 200704122300]
         org.netbeans.modules.xml.xdm/1 [1.1.30 1 200704122300]
         org.netbeans.modules.cnd.repository [1.1.1 070814]
         org.netbeans.upgrader [4.5.31 200704122300]
         com.sun.tools.swdev.projectimport/1 [1.1.1 070730]
         org.netbeans.modules.defaults/1 [1.2.31 200704122300]
         org.netbeans.modules.html/1 [1.20.30 200704122300]
         org.netbeans.modules.xml.schema/1 [1.12.30.4 200704122300]
         org.netbeans.modules.editor.settings.storage/1 [1.4.31 200704122300]
         org.netbeans.modules.autoupdate/1 [2.16.31 200704122300]
         org.netbeans.modules.options.editor/1 [1.2.31 200704122300]
         org.netbeans.modules.properties.syntax/1 [1.17.31 200704122300]
         org.netbeans.configuration.api [1.1.1 070814]
         com.sun.tools.swdev.advtools.actions.control [1.1.1 070730]
         org.netbeans.core.ide/1 [1.9.31 200704122300]
         com.sun.forte.st.mpmt/1 [8.2]
         com.sun.tools.swdev.advtools.actions.performanceanalyzeractions/1 [1.1.1 070730]
         org.netbeans.modules.extbrowser/1 [1.10.30 200704122300]
    ConfigurationDescriptorProvider: I/O in EQ is not good idea
    THANKS AGAIN AND REGARDS,
    John

  • Compile multiple source files

    sorry, this is maybe a newbie question.
    but iI have a problem compiling an application that use multiple sources files
    for exemple
    the class A is in the file 1
    the class B is in the file 2
    class A uses an instance of the class B
    class B uses an instance of the class A
    so i'm unable to compile these files coz each one tells me he doesn't know about the other
    Is there a way to define prototypes of class or fonctions before their use like in C/C++?
    Or is there another way i didn"t pay attention
    thanks all

    This is a minimal explanation of packages. For a full explanation of packages and how to compile and run Java programs, see this page:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/tools.html
    and read the Setting the Classpath and the How Classes are Found topics.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    And a statement to run the program is:
    java myapp.aProgram
    (This can be issued from any directory, as Java will search for the program, starting the search from the classpath directories.)
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • Java Source File

    I would like an explanation for the following:
    I have two public classes in one source file, one is nested inside another. Now, it was my understanding that you can only have one public class in one source file. Can somebody, please, explain me this?
    Thanks,
    Boris.

    ummm... the class is public and can be accessed from outside the class, the requirement is that there can be only one package level class in on source file. If the one of the public classes is nested, no problem :)

  • Loosing source location with separate source files

    Hi,
         I am compiling my code with g++ (version 2.8.1) using the -g option. When I use one large source file with all my classes and the main routine in it, I can browse the source in the analyzer GUI. If I split out all classes into separate source files (which I was hoping would help me maintain the code better), I am no longer able to browse the source files. Analyzer complains about the directory where all source files live not being accessible.
    thanks for any input anyone might be able to offer!
    h.

    In Windows XP the path should be
    c:\Documents and Settings\<username>\Application Data\com.adobe.formscentral.FormsCentralForAcrobat\Local Store\data
    You might notice that in that folder the images and forms are saved as separate objects and not all in one file like the FCDT file.
    For local file the FCDT contains all you need. If you ever move to online forms and start collecting data then you will notice that that FCDT doesn't contain the data recieved but only the design of the form. In the case you move the form online then we never save the form locally so there is no way to use a source control to save the form other again than just saving the design format (fcdt file) and not the data received.
    You can vote for a new request here http://forums.adobe.com/community/formscentral?view=idea (click on the "Create an idea" in the top right corner)
    hope this helps
    Gen

  • *Added* code to existing source file, compiled it, and class file shrunk

    Another newbie here. Fortunately, my classpath is ok, so I'm able to compile a .java file.
    I added one line of code (System.out.println) to write the value of a variable to a log. After compiling with javac, I noticed that the resulting [new] class file was smaller than the existing class file. I looked at each of the class files with Textpad. It's gibberish, but I quickly saw that a large block of code was missing in the new class file, even though the size of the source file had been increased.
    There is a difference, however, between how the two class files were created. The existing class file was compiled (along with many others) by exporting an .EAR file from a development environment (WSAD) to the WebSphere Administrator Console. Conversely, I am now compiling the same source file with javac on my machine.
    I suspect that this is the reason why I can add code to a .java file, compile it, and have the resulting class file actually lose code. Even if I am correct, I don't know what to do about it.
    Does anyone have an idea?
    Regards,
    Daniel T.

    Thank you both for your replies. I've read many posts over the past few months, and I know how important it is to provide as much info as possible, when asking a question here. That said, I have another tasty tidbit...
    After replacing the existing (larger) class file with the new (smaller) class file, my application now produces this:
    "*Error 500: LinkageError while defining class*..." [name of class]
    *"...(Unsupported major.minor version 50.0) This is often caused by having a class defined at multiple locations within the classloader hierarchy. Other potential causes include compiling against an older or newer version of the class that has an incompatible method signature. Dumping the current context classloader hierarchy: ==> indicates defining classloader ==>[0] com.ibm.ws.classloader.CompoundClassLoader@6bd156d5 Local ClassPath:"*
    ...[the entire classpath]...
    Original exception--- java.lang.UnsupportedClassVersionError:
    I'm guessing that my focus should mostly be on the 'Original exception', and maybe I need to revisit the JRE or JDK or JVM (these terms are somewhat nebulous to me, so please forgive me using them interchangeably) on my machine. For now, I'll just keep trying stuff. Thanks again for the replies!
    Regards,
    Daniel T.

Maybe you are looking for