Compiling files belonging to a package..URGENT!!

Dear all,
c:>
|___X.java
|
|___aces___Y.java
--------------------X.java------------------------------
import aces.*;
public class X {
public X() {
public static void main(String[] args) {
new X();
new Y();
System.out.print("nHello");
--------------------Y.java-----------------------
package aces;
import X;
public class Y {
public Y() {
X x = new X();
When i compile these two files in a JBuilder project
(i made sure "Y.java" is in "aces" folder and CLASSPATH is set
to "c:\")the compiler says,
"Y.java": '.' expected at line 3, column 9
"X.java": class Y not found in class X at line 10, column 9
When i try commenting line 3(import X;) of "Y.java" the error is
"Y.java": class X not found in class aces.Y at line 9, column 13
do u have any idea how to compile? thanks your attention...

I take it you have set the project properties correctly in JBuilder to use c:\ as the source directory?
If not that's your problem right there and it does seem to be the most likely cause.
Also, you have circular dependencies. I don't know if they're allowed (I'd imagine not) but even if they are they're extremely dirty.
How can the compiler EVER compile the one class without having a compiled class from the other one to import (which itself calls the class it's being imported to which... you get the point?).

Similar Messages

  • Compiling files with the 'package'-statement

    Hi,
    I have a problem compiling files that uses the 'package'-statement:
    I have 2 files ClassA.java and ClassB.java. ClassA uses objects of type ClassB. When I compile ClassA.java the compiler also automatically compiles ClassB.java. No problem so far.
    But when I add "package mypackage" to ClassA.java and ClassB.java and then try to compile ClassA.java with the command "javac -d . ClassA.java" I get the compile-error "Class mypackage.ClassB not found". This would mean that I would have to compile all my files separately?
    Can anybody tell me what I am doing wrong?
    Thx,
    Jan

    I was still working on it, but I think I have it now :-)
    Let me try to summarize what I think/hope that I understand:
    I have the following files in package mypackage:
    C:\src\mypackage\ClassA.java
    C:\src\mypackage\ClassB.java
    with ClassA using ClassB.
    I want to compile them into C:\classes\mypackage\ClassA.class and C:\classes\mypackage\ClassB.class
    I change directory to C:\classes and then give the command
    >javac -d . ..\src\mypackage\ClassA.java
    This didn't work at first because my classpath wasn't set correctly. To make it work I had to add C:\src to my classpath. Which surprised me a little because I thought that the classpath was only used to find *.class files and not by javac to find *.java files?
    If anybody has something to add to this, please feel free to do so.
    Jan

  • Is there a way do find out to which package a file belongs?

    If pacman tries to install a package it is normally aware of files beeing already installed and puts out an error message. Is it possible to encounter to which package a file belongs, t.m. which package did install it?

    pacman -Qo <file>
    For example,
    $ pacman -Qo /usr/bin/python
    /usr/bin/python2.5 is owned by python 2.5.1-5
    It's all in the manpage for pacman.

  • SSIS Job is getting failed with an error "0x00000005 : Failed to compiled scripts contained in the package.

    Hi All. Could anyone resolve my issue.
    I was created a package with an Script task written in VB.Net.
    The Package was executing Successfully in BIDS.
    But when i tried to exceute the same using Sql server Agent Job, Its getting Failed with the below error message
    "Executed as user: Admin. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  5:12:27 PM  Error: 2013-03-13 17:12:32.33    
    Code: 0x00000005     Source: Checking Alcon Files Checking Alcon Files     Description: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors. 
    End Error  Error: 2013-03-13 17:12:32.33     Code: 0x00000005     Source: Checking Alcon Files Checking Alcon Files     Description: BC30179 - enum 'ScriptResults' and enum 'ScriptResults' conflict
    in class 'ScriptMain'., ScriptMain.vb, 156, 22  End Error  Error: 2013-03-13 17:12:32.36     Code: 0x00000005     Source: Checking Alcon Files Checking Alcon Files     Description: The binary
    code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.  End Error  Error: 2013-03-13 17:12:34.28     Code: 0x00000005    
    Source: Formating Excel Sheet Formating Excel Sheet     Description: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.  End Error  Error: 2013-03-13 17:12:34.28    
    Code: 0x00000005     Source: Formating Excel Sheet Formating Excel Sheet     Description: BC30179 - enum 'ScriptResults' and enum 'ScriptResults' conflict in class 'ScriptMain'., ScriptMain.vb, 191, 22  End Error 
    Error: 2013-03-13 17:12:34.29     Code: 0x00000005     Source: Formating Excel Sheet Formating Excel Sheet     Description: The binary code for the script is not found. Please open the script in the
    designer by clicking Edit Script button and make sure it builds successfully.  End Error  Error: 2013-03-13 17:12:51.56     Code: 0x00000004     Source: Checking Alcon Files      Description:
    The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.  End Error  Error: 2013-03-13 17:12:51.56     Code: 0xC0024107    
    Source: Checking Alcon Files      Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  5:12:27 PM  Finished: 5:12:51 PM 
    Elapsed:  24.336 seconds.  The package execution failed.  The step failed."
    Please give some solution to this.
    Thanks in advance

    Are you editing this job in SQL 2012? Is it wrapping your paths in \"? Like for example does the command line tab on the step look like this:
    /FILE "\"D:\yourPathGoesHere.dtsx\""  /CONFIGFILE "\"D:\yourPathGoesHere.dtsConfig\"" /CHECKPOINTING OFF /REPORTING E
    That's the problem I had, and I resolved it by recreating the whole thing via SQL Script and getting rid of all those \" things. I think that is preventing SSIS from looking up the precompiled binaries for your Script Task. So you should edit the command
    line manually:
    /FILE "D:\yourPathGoesHere.dtsx"  /CONFIGFILE "D:\yourPathGoesHere.dtsConfig" /CHECKPOINTING OFF /REPORTING E
    Please write back whether that helps you. David Dye's answer didn't help me at all.

  • Problem on how to create a .h file in a java package !!

    Hello,
    Please help me!! I have a problem generating a header file inside a java package. As I do not think eclipse IDE can do that, I then have to use the command as following in the command prompt instead.
    D:\myJava\workspace\myJNI\bin>javah sysHookJNI/PollThread
    javadoc: error -Illegal package name "sysHookJNI/PollThread"
    sysHookJNI is my package name and PollThread is my class name. I think it should works because I compiled it with similar format as>java sysHookJNI/PollThread.java and it outputs the PollThread.class, but in fact it doesnot !>_<.
    Can anyone suggest me what I should do?
    Big thanks in advance,
    Neth

    Thank you so much !!
    But after I got that point my old problem is still not solved with that. After my sysHookJNI.PollThread.h is generated, I compiled everything over and then run Test by
    : java Test and the Exceptions are occurred as:
    Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: sysHookJNI.PollThread.checkKeyboardChanges()V     at sysHookJNI.PollThread.checkKeyboardChanges(Native Method)
         at sysHookJNI.PollThread.run(PollThread.java:21)
    And this is my PollThread.java (actually I took it from Jacob )
    //PollThread.java
    package sysHookJNI;
    import java.io.*;
    public class PollThread extends Thread
         public native void checkKeyboardChanges();
         private KeyboardHook kbh;
         public PollThread( KeyboardHook kh )
              kbh = kh;
              System.loadLibrary("syshook");
         public void run()
              for(;;)
                   checkKeyboardChanges();
                   yield();
         void Callback( boolean ts, int vk, boolean ap, boolean ek )
              KeyboardEvent event = new KeyboardEvent( this, ts, vk, ap, ek );
              if( ts )
                   kbh.keyPressed( event );
              else
                   kbh.keyReleased( event );
    }Anyone has any suggestion about this problem? I really have no clue about it!! it keeps complains the same things no matter I regenerated header file or not.. T_T
    Btw, shall I make a new post about this problem?
    Thanks for your time,
    Edited by: Nethie on Nov 1, 2009 2:37 PM

  • Export file framework.exp of package javacard.framework not found

    Hi,
    trying to convert the HelloWord example of the Sun Javacard Kit (2.2.2), i get the "error: export file framework.exp of package javacard.framework not found". I have compiled the file according to the documentation and i am still following the documentation for converting it.
    this is the command i use:
    %JC_HOME%/bin/converter.bat -config C:\java_card_kit-2_2_2\samples\src\com\sun\javacard\samples\HelloWorld\HelloWorld.opt
    Ideas?
    Thanks
    Edited by: uig on Oct 23, 2007 7:54 AM

    how did you compile ur helloworld.opt file coz when i tried it i got this err msg
    call %JC_HOME%\bin\converter -config ..\src\com\sun\javacard\samples\HelloWorld\HelloWorld.opt
    and got this err
    Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jre1/6/0_03\lib\ext\QTJava/zip;

  • Extracting class files of a certain package from a jar.

    Hi,
    I want to extract all the class files belonging to a certain package from a JAR file containing class files belonging to a different packages.
    Can I do this using the jar tool, or use some other unzipping tool?
    If it is best to use an unzipping tool which one can I use for windows?
    Thanks,
    Niranjan.

    jar xf file.jar path/to/dir
    For more info see http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/jar.html.

  • How compile an entire tree structure packages in JDev

    Hello there
    When i use jdev i have the src folder (source files) and the classes folder (compiled files) as Jdev makes them, but the compiled files are not updated correctly.
    For eg. i created a batch file that runs the application with this content
    echo on
    C:
    set path=C:\Program Files\Java\jdk1.6.0_11\bin;%path%
    set classpath=
    cd C:\jdevstudio10133\jdev\mywork\Supreme\ProjectServer\classes
    java project.main.Main
    And the application started is an older version of the application that i have now, if i put the first line System.out.println("Message") even if i make and rebuild the project, the message will not appear and i dont know how to get the compiled files.
    Also i tried to find out how to compile a tree structure of packages from command line but it seems very difficult. If anyone can give a reference.
    Thank you.

    User,
    you left out vital information. Read this post before posting.
    what happens if you delete the whole classes folder and rebuild the application? JDev will recreate the folder and you should see all changes then. If not you are not running the right classes.
    Timo

  • Moving a business component to a business component package URGENT

    Hi there,
    Aim: I want to use one the attributes from an existing EO, by creating a VO which points to the EO.
    Procedure taken: I've downloaded the EO.class and EO.xml file from the database to my local machine. I've opened the EO.class and EO.xml file within jdeveloper and it automatically adds it to my project path (not business component package). I've shown the dependencies of the two files and thus know which business component package (path) they belong to. I've created a business component package which is the same (path) as the one shown through dependency.
    Problems: I try to move the EO.class and EO.xml file to business component package created but it won't move. I want to create a VO pointing to the EO but if the EO is within the project path and not a business component package it won't let me refer to it.
    Question: How can I add the EO to the business component package?
    Thanks in advance

    If this is the same issue as this thread, then please follow the discussion there.
    Adding an existing Oracle Standard EO to my project
    Thanks
    Tapash

  • Compiling files with nested directory structure

    I'm getting "resolve symbol" errors when I try to compile source files which
    are in the child directory whose dependent on files from it's parent
    directory. Here's my current directory structure:
    src
    -->a
    ---->b
    ------>util
    What I'm trying to do is compile files which are in the 'util' directory.
    Some of these files use some of the classes in the 'b' directory. My
    compile statement is the following:
    java -d class -classpath src src\a\b\util\aFile.java
    Files in the 'util' directory has a import a.b.* statement on top, but I
    don't think that's the problem, let alone necessary.
    Any assistance would be appreciated.

    Files in the 'util' directory has a import a.b.*
    statement on top, but I
    don't think that's the problem, let alone necessary.You must import classes that you use if the classes are not in the same package. The classes in src\a\b should have a package statement as the first line of source code and I am guessing it should be "package a.b;" Likewise, the classes in src\a\b\util should have a "package a.b.util" line. It's hard to guess what you have in mind. If you have the package statements, then the classes in a.b.util can import a.b.whatever. This will work.

  • Compiling application (with several sub-packages) from another java app

    Hi,
    I'm writing my own build tool and need to be able to compile an external application (pulled from cvs, subversion, ...) from within this build tool.
    Probably I need to use com.sun.tools.javac.Main.compile ?
    But how do I pass classpath, output dir, etc to this class and how can I make it compile all files in all (sub)packages of the given folder ?
    thanks for any help.

    Never mind my previous post, I found a solution to the "the input line is too long" problem:
    Putting all the files in a temporary file and then providing that file as the source to compile, like this:
    javac -g:none -cp <classpath> -d classes @sourcefiles.txtwhere sourcefiles.txt is the name of the temporary file that contains the names of the source files (note the "@"-prefix)
    For some reason, this is not mentioned/documented in the java docs (at least not in my docs)
    Ok, so everything is compiling now, but I have one problem remaining:
    For each "module" that I compile (the application I use for my tests consists of several "modules", i.e. subpackages), I get an error stating that "The system cannot find the path specified"
    This seems obvious, because it is trying to write a file <package-name>\classes\<package-name>\<classname>.class
    But why is it trying to write that file ?
    -> Is this a known bug or something ?
    Let me explain a little more...
    For each compilation I do using the com.sun.tools.javac.Main.compile() method, it is giving this error.
    Everything is compiling correctly, but it seems it is trying to write an extra class file to a wrong path.
    Until now, it was always the first file in the row that gave the problem.
    Example:
    ** module 1:
    sources/com/example/module1/class1.java
    sources/com/example/module1/class2.java
    sources/com/example/module1/class3.java
    sources/com/example/module1/sub1/subclass1.java
    sources/com/example/module1/sub1/subclass2.java
    sources/com/example/module1/sub1/subclass3.java
    ** module 2:
    sources/com/example/module2/class1.java
    sources/com/example/module2/class2.java
    sources/com/example/module2/class3.java
    sources/com/example/module2/sub1/subclass1.java
    sources/com/example/module2/sub1/subclass2.java
    sources/com/example/module2/sub1/subclass3.java
    => My application will compile module 1, do some other things with it and the module 2 and again do some other things with it.
    The result would be:
    Application started.
    Loading configuration: OK
    Compiling sources for module module1: E:\temp\_User_\project\packaging\workingdir\source\com/example/module1\class1.java:12: error while writing com.example.module1.class1: com\example\module1\classes\com\example\module1\class1.class (The system cannot find the path specified)public class class1 extends Thread {
           ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error
    OK
    Note: Contents of my classes directory for module1:
    classes/com/example/module1/class1.class
    classes/com/example/module1/class2.class
    classes/com/example/module1/class3.class
    classes/com/example/module1/sub1/subclass1.class
    classes/com/example/module1/sub1/subclass2.class
    classes/com/example/module1/sub1/subclass3.class
    => all class files are correctly compiled
    Compiling sources for module module2: E:\temp\_User_\project\packaging\workingdir\source\com/example/module2\class1.java:12: error while writing com.example.module2.class1: com\example\module2\classes\com\example\module2\class1.class (The system cannot find the path specified)public class class1 extends Thread {
           ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error
    OK
    Application finished without errors.
    Note: Contents of my classes directory for module2:
    classes/com/example/module2/class1.class
    classes/com/example/module2/class2.class
    classes/com/example/module2/class3.class
    classes/com/example/module2/sub1/subclass1.class
    classes/com/example/module2/sub1/subclass2.class
    classes/com/example/module2/sub1/subclass3.class
    So, as you can see everything compiles as expected, but an error message is displayed related to each first file that is compiled.
    ==> Is this a known issue ?
    ==> What can I do about it ?
    Suggestions welcome

  • Compile File vs. Compile All

    Hi All,
    This is probably an easy one. What is the difference between File>Administration>Compile File (ctrl t) and Program>Compile>All (shift+ctrl+k)?
    And does one need to do both before running a form?
    Bradley

    Control+Shift+k recompiles all PL/SQL inside the module, but does not generate any external file.
    Control+t generates a new executable (*.fmx) and in the process will only re-compile PL/SQL in the module that it thinks are dirty.
    As a matter of course I tend to do a Control+Shift+K before doing a Control+t. This is most sensible when you have a lot of changing external dependances in Database packages and libraries.

  • Creating an executable jar-file including a custom package

    I am trying to learn how to create executable jar-files. I have managed this with a single class. However having a class which is an extention of another class which in turn belongs to custom package, I can't make it work.Running the program normally is not a problem. I don't think the problem is the actual code, but I will include it here anyway. I create the jar-file using:
    jar -cmf Direkt2b.txt Direkt2b.jar *.class
    where Direkt2b.txt is just:
    Main-Class: Diriekt2b
    Only the main class-file is included this way. Copying the other file to the same directory before creation doesn't help either. There is no error messages, the jar-file just refuses to run no matter what.
    The main-class:
    import java.awt.*;
    import extra.*;
    class Direkt2b extends ExtendedFrame {
         Font f;
         Direkt2b() {
              f = new Font("SansSerif", Font.BOLD, 24);
              setBackground(Color.yellow);
              setSize(400,150);
         public void paint(Graphics g) {
              g.setFont(f);
              g.setColor(Color.blue);
              g.drawString("V?lkommen till Java Direkt", 45, 100);
         public static void main (String[] arg) {
              Direkt2b d2 = new Direkt2b();
              d2.setVisible(true);
    The help-class:
    package extra;
    import java.awt.*;
    import java.awt.event.*;
    public class ExtendedFrame extends Frame {
         private static boolean first = true;
         private boolean isFirst = first;
         public ExtendedFrame() {
              addWindowListener(theListener);
              first=false;
         WindowAdapter theListener = new WindowAdapter () {
              public void windowClosing(WindowEvent e) {
              dispose();
              if (isFirst)
                   System.exit(0);
    }

    My problem wasn't really getting more than one class in a jar-file,
    but rather that my jar-file with multiple classes wouldn't execute.
    Reading the original post I realized that maybe I was unclear about that.
    However I have solved the problem now so for anybody reading this
    thread in the future I will tell you how.
    The general setting is this: You have a bunch of self-made help-classes
    organized in some classdirectory somewhere in the filesystem. You use these
    in your programming from time to time. You have set a classpath-varible
    in your OS such that Java could find your help-classes.
    Now you want to create executable jar-files so that you could publish your work.
    My problem was that while I added all needed classes in a jar-file, the main-class
    couldn't find the others because they were referenced incorrectly. The solution I
    came up with may not be elegant, but it works. I copied the main-class and all directories
    (only one in my case) just as they appear in the classpath-directory, to the same temporary
    directory. Then I created the jar-file from there, using: jar -cmfv Direkt2b.txt Direkt2b.jar Direkt2b.class extra/*.class
    I suspected that incorrect referencing was the problem and I tried several variations on the theme above
    before giving up and writing the first post. Part the problem was that I didn't get any error messages,
    just an annoying error-sound double-clicking the jar-file. I learned later that you could run jar-files from
    the command -prompt using: java -jar myjarfile.jar. This way you get a more useful response.
    I guess there is a way to include the classpath instead somehow, but I will use my method for now.
    I hope this was helpful to somebody.

  • Can no longer print multiple files from a PDF package

    Prior to our upgrade to Acrobat Pro X, we had the ability to print multiple files within a PDF package.  We would simply select the files we wanted to print, say print and it would print them all.  It no longer does so, although it still allows us to select multiple files and to select ALL from the print menu but then it only sends the first file to the printer.
    We have tried it on both Windows XP and Windows 7 and it won't work correctly on either one.
    Does anyone have any ideas?  This is very frustrating as these packages are created by folks bundling their e-mail messages to send to the fileroom for printing and filing in the official case files.  With the old method we were able to quickly print out all the messages without attachments, and then would only have to individually print those messages that had attachments.  As stands now if we get a package with 100 messages in  it we will have to select and print each file individually instead of being able to print the 75 without attachments as one print job and then only have to do the seperate handling for the remaining 25 with attachments.
    Any and all suggestions are welcome.

    I'm using windows 7. The Acrobat that came with the Adobe Creative Suit 4 is Adobe Acrobat Pro. When I am on a web site that has a page in PDF I click on the printer icon and the print page comes up but the preview side is blank and will not print the page.

  • Can't open pdf. files something about patch package

    Can't open PDF files something about patch package verification.error.

    I am having the same issue.  Unable to open ANYTHING related to adobe (PDF, downloads), as well as unable to delete and reinstall or even change or correct. 

Maybe you are looking for

  • BreakOpportunity is not defined?

    I have a Flex application that I'm now trying to create an AIR version for. I created a class to help display subscripts and superscripts through the TLF. It seems to die as soon as it tries to import to flow: _textFlow = TextConverter.importToFlow(t

  • Where can I find the plugins folder when I have opened PSE13? I miss it in this version! If so why did Adobe removed it? Then this version has no use to me.

    I just purchased PSE13 and after installing I noticed that I can't find my plugins  while I could easily open it in my PSE11. Why did Adobe removed it???  If so I think I will install PSE11 again. Kind-a weird that this version doesn't have a plugin-

  • Testing ALE Interface

    Hi Friends, How do we test ALE Interface. Please provide me with stpes for configuring the ALE Interface for SAP-SAP,SAP-Non SAP scenarios on Outbound & Inbound Systems. After configuring,How do we send the data. <REMOVED BY MODERATOR> Thanks Edited

  • XMLProvider ?

    I have this URL set in the SampleXML channel for the xml feed. http://api.yellowbrix.com/api/?service=headlines&id=apidemo&method=xml&password=4l5s3oru&category=AP+Top+Headlines I could able to resolve this in my browser, in PS machine (using netscap

  • Kernel update of CI with application instance

    We have JP ux with SAP 5.0 , oracle , we allready performed kernel update on DEV & QA , i want to know the procedure for CI with APP instance, do i need to update both saperately ? regards Sachin Sonawane