Problem in importing package

i am new to java and facing problems in importing package which are self made.
secondly does JDK 1.1.3 can support swing

Hi,
I had some problems myself. I will add few lines, maybe it helps:
OK, let's assume that you work in a directory. In this case, set classpath to this hierarchy as well as to "." ('this' hierarchy - like in DOS).
Now, assume that you want to use packages MyPack1 and MyPack2. The source files of classes belonging to MyPack1 must:
- start with command
package MyPack1;
- be located all in the directory MyPack1
(and the same for MyPack2, of course)
If you want to use MyPack1 within MyPack2, you have to include:
import MyPack1.*;
even though MyPack1 is, in fact, located on path: ../MyPack1/*
(trust the classpath is important here)

Similar Messages

  • Problem with Importing Packages

    I have a file which has several classes and an interface. The first line is package ImageSequence; . It is saved in a file called ImageSequence.java. I have another file in the same directory that has include ImageSequence.* as the third line. I get an error that the package is not found. What is wrong?

    Thanks, but that still doesn't solve the problem. I have this code:
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    import ImageSequence.*;
    public class ImageSequenceTest extends JComponent {
         public static void main(String args[])
              new ImageSequenceTest();
         public ImageSequenceTest()
              Toolkit toolkit = Toolkit.getDefaultToolkit();
              Image i1 = toolkit.getImage("ImageSequenceTesti1.gif");
              Image i2 = toolkit.getImage("ImageSequenceTesti2.gif");
              Image i3 = toolkit.getImage("ImageSequenceTesti3.gif");
              Image i4 = toolkit.getImage("ImageSequenceTesti4.gif");
              Image i5 = toolkit.getImage("ImageSequenceTesti5.gif");
              Image i6 = toolkit.getImage("ImageSequenceTesti6.gif");
              Image images[] = new Image[] {i1, i2, i3, i4, i5, i6};
              ImageSequence is = new ImageSequence(images, 50);
              JFrame frame = new JFrame();
              frame.setSize(100, 100);
              frame.getContentPane().add(is);
              frame.setVisible(true);
              is.setRepeat(true);
              is.start();
    }When I try to compile it, I get these error messages:C:\Program Files\Xinox Software\JCreator LE\MyProjects\ImageSequenceTest.java:22: cannot resolve symbol
    symbol : constructor ImageSequence (java.awt.Image[],int)
    location: class ImageSequence
              ImageSequence is = new ImageSequence(images, 50);
    ^
    C:\Program Files\Xinox Software\JCreator LE\MyProjects\ImageSequenceTest.java:25: cannot resolve symbol
    symbol : method add (ImageSequence)
    location: class java.awt.Container
              frame.getContentPane().add(is);
    ^
    C:\Program Files\Xinox Software\JCreator LE\MyProjects\ImageSequenceTest.java:27: cannot resolve symbol
    symbol : method setRepeat (boolean)
    location: class ImageSequence
              is.setRepeat(true);
    ^
    C:\Program Files\Xinox Software\JCreator LE\MyProjects\ImageSequenceTest.java:28: cannot resolve symbol
    symbol : method start ()
    location: class ImageSequence
              is.start();
    ^
    4 errors
    When I get rid of import ImageSequence.*; and copy the code for the ImageSequence class from the package into the file, everything works.

  • Problem for import & package

    Hi, I got a problem about the import and package , my problem is like that : I write 2 java files call Test.java (C:\..\test\GetAdd\Test.java) and Tambah.java(C:\..\test\tambah\Tambah.java)
    //Test.java
    package test.GetAdd;
    import test.tambah.*;
    public class Test
    private Tambah add = new Tambah();
    public Test()
    System.out.println(add.get());
    public static void main(String[] args)
    Test t = new Test();
    //Tambah.java
    package test.tambah;
    public class Tambah
    public int get()
    int h = 5;
    return h;
    When i compile this 2 java files, it got error that say can't resolve class Tambah, why?
    Thanks

    http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/classpath.html
    (For a casual compiling use the console window with the parent directory of your "test" directory as the current directory, and the command above.)

  • Problem with importing packages in servlet

    Hi all,
    I am a newbie to java so please bear with me...
    I am trying to create a java servlet but Eclipse is giving me errors such as:
    'the import org.apache.struts cannot be resolved' in the following line:
    import org.apache.struts.action.Action;
    My environtment is:
    Windows 2000
    Tomcat 5
    j2sdk1.4.2_04
    struts 1.1
    Any help would be greatly appreciated.
    Thanks
    John

    you need to add the struts.jar to your classpath

  • Visual age problem - importing packages

    Hello,
    I have created a Java client NT application on Visual Age which interacts with Oracle database thru JDBC driver.
    when i give
    import oracle.jdbc.driver.*;
    the visual age editor is not able to find the above package, whereas when i export the same application and execute it on DOS environment there are no problems.
    I want to know the best way to import packages in Visual Age because when I added the required packages to my application, "no suitable driver" error occurred.
    Not as familiar with Visual Age. Any help would be appreciated. Thanks :-)
    Raj

    Thanks! Got it fixed.
    Giving the duke dollar to myself ;)
    raj

  • Problem importing packages via ICE??

    Hello,
    I am running Portal 6.0 on Windows Server. For one of the business package that is to be implemented in my Portal, i have to deploy two files as a pre-requisite that are associated with SAP Note 660777(https://service.sap.com/sap/support/notes/660777). I have imported the "com.sap.pct.crm.kmconfig40.par" file but having problems deploying "fullupdate_completeBP602.zip". I must admit that i haven't got much idea about importing packages via ICE as i have never used it before.
    I tried to import it via, Portal->System Administration->System Configuration. In there, Actions->Import. When i point to the "fullupdate_completeBP602.zip" file and say Preview, i get a error message saying "Enter a valid configuration archive name". Isn't this the right way to import this package? Please guide. Thanks.
    Regards,

    I suggest you also ask in the KM forum about ICE. There is also some information in the SAP help pages about ICE. For example an overview of it can be found
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/63/42aa17425c514f85ad5ecd45988509/frameset.htm">here</a>
    Cheers

  • Import package problem

    hi,
    I am trying to import some classes into my java file.The path is as follows:
    "c:\tinyos\tinyos-1.x\tools\java\net\tinyos\mcenter\treetable".I am importing the classes in the treetable package.
    when I write import tinyos.tinyos-1.x.tools.java.net.tinyos.mcenter.treetable,a problem occur because of the folder tinyos-1.x. do you have any idea about this situation? :(
    thanks in advance

    You are right, I cannot use "-" character in a Java identifier. In fact, you exactly point to the problem. The package I want to import is actually net.tinyos.mcenter.treetable. However, I have two similar "net" directories. their exact paths are as follows:
    1. c:/tinyos/cygwin/home/tinyos/tinyos-1.x/tools/java/net
    2. c:/tinyos/cygwin/opt/tinyos-1.x/tools/java/net
    I need to import the classes in the first "net" directory. However, it tries to find the classes in the second path and gives errors. therefore, I need to specify them exactly or somehow distinct them.
    Could you help me?
    thanks..

  • IMPORTING PACKAGE PROBLEMS

    Hi,
    I'm having problems with importing the following:
    import javax.swing.*;
    import javax.crypto.*
    I am currently using JDK1.3.1_01. I've looked in the main java folder there is no 'javax' folder, hence thats why the error message appears:
    package javax.swing.* does not exist
    What am i doing wrong? Is it contained in a Zip or Jar file or something, if so where? Do I need to make some Classpath setting?
    Please help giving me clear instructions as im no expert.
    thanx
    RIA

    Yes...I named the objects with capital letters e.g.
    JComboBox SexComboBox = new JComboBox();well, it would be a bit more readable to start object names with a lowercase letter
    (you might want to read about naming conventions one day: http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html)
    I added some comments to your code:
    SexComboBox.addActionListener(new
    java.awt.event.ActionListener() {
       /* This IS illegal syntax. The previous line starts a class definition.
           You should see at least one method declaration here:
            public void actionPerformed(ActionEvent e) {
            } // actionPerformed
          } // ActionListener
          I guess some lines have dropped out from your code here, because the
          following lines do not look like ActionListener code.
          You could try using the codelines above to fix your code
       SexComboBox.setEnabled(true);
       //Setup the sexComboBox item
       SexComboBox.addItem("Male");
       SexComboBox.addItem("Female");
       YearLabel.setText("Year");
       //setup the YearComboBox Item
       YearComboBox.addItem("1900");
       YearComboBox.addItem("1901");
       YearComboBox.addItem("1902");
       YearComboBox.addItem("1903");

  • Import package problems

    hi:
    if my program need to import package A which store in :
    C:\Documents and Settings\sharon\My Documents\project
    and my java file also store in the same folder, but i always got this error:
    C:\Documents and Settings\sharon\My Documents\project\test.java:36: package A does not exist
    import A;
    can anyone please tell me what happen? i m a newbie to java, pls help.

    Assuming you have the following: C:\project\A\Class1.class
    C:\project\A\Class5.class
    C:\project\test.javaand assuming all the Class1.java-Class5.java files start with package A; and assuming test.java starts with import A.Class1; And assuming javac.exe is in a directory that's on your path (NOT classpath), then if you do, in a DOS promptjavac -classpath . test.java
    or
    javac -classpath C:\project test.java it will work.
    You say you're using an IDE. Somewhere in that IDE's preferences/options will be a place to set the classpath. It must include . (a dot, meaning the current directory) OR the full path up to and including ...\project. (Dot may actually not work, since the IDE might not have the same notion of "current directory" as you would in a DOS prompt. There may also be a setting for "project root" or something. It really depends on the IDE.)
    Side note: Convention in Java is for package names to be all lowercase, and for class names to start with uppercase.

  • Error while running import package

    Hi,
    Transformation file was validated successfully. But after running import package i am having following error on MS-BPC-7.0.
    Invalid character in the given encoding. Line 1, position 1.
    When i try validate and process trans file i am having the following error message. But same data file and same trans file was working till couple of days ago. After that whatever changes i have made to file, i did revert them to have it working like beofre.
    Warning: Some records were rejected.
    Rejected records reference either calculated members or invalid members.
    Actually rejected record is only, one, but even other data was not loaded.
    Thanks in advance for sharing your ideas or similar experiences.
    Thanks,
    KK

    Hi,
    There is definitely some problem with one of the records there. Do you have header? What is the delimiter? Do you have the same delimiter in the transformation file? You need to take a look at all the possibilities.
    Hope this helps.

  • Problem Running SSIS Package with a SQL Server Agent

    SQL Server: SQL Server 2012
    VS: Visual Studio 2012
    Hello,
          I have been having a problem running SSIS packages by using a SQL Server Agent job. I first created these SSIS packages in a separate IS project in Visual Studio. I imported the packages to the Integration Services (Package
    Store) instance on my SQL Server and tried to create a job that would run them from there.
          At first I read around about needing a proxy account to allow the agent/packages to access the file system since these packages are importing data from a flat file in the SQL database. So I created a temporary admin user to
    use as the user for the agent. I did this by going to Services.msc on the server and linked the account the agent's "logon as". Then arose another issue where I am getting an error about using the incorrect type for my connection managers.
    The connection manager "TestFile" is an incorrect type.  The type required is "OLEDB". The type available to the component is "FLATFILE". Source: Data Flow Task Flat File Destination [2]     Description:
    Cannot open the datafile "O:\*****\Success.txt"
    I am not sure what this even means as I am getting this error even with a test package that doesn't do anything with the database. I have just two flat file connection managers  in this test project one for grabbing the source file and one for
    creating the new test file.
    I am not sure what to do.
    Thanks in advance,
    Matt

    I accidently created two posts. The newest one has the details.
    I did not mean to.
    SQL Server: SQL Server 2012
    VS: Visual Studio 2012
    Hello,
          I have been having a problem running SSIS packages by using a SQL Server Agent job. I first created these SSIS packages in a separate IS project in Visual Studio. I imported the packages to the Integration Services (Package
    Store) instance on my SQL Server and tried to create a job that would run them from there.
          At first I read around about needing a proxy account to allow the agent/packages to access the file system since these packages are importing data from a flat file in the SQL database. So I created a temporary admin user to
    use as the user for the agent. I did this by going to Services.msc on the server and linked the account the agent's "logon as". Then arose another issue where I am getting an error about using the incorrect type for my connection managers.
    The connection manager "TestFile" is an incorrect type.  The type required is "OLEDB". The type available to the component is "FLATFILE". Source: Data Flow Task Flat File Destination [2]     Description:
    Cannot open the datafile "O:\*****\Success.txt"
    I am not sure what this even means as I am getting this error even with a test package that doesn't do anything with the database. I have just two flat file connection managers  in this test project one for grabbing the source file and one for
    creating the new test file.
    I am not sure what to do.
    Thanks in advance,
    Matt

  • Import package from one project into another

    Hello everyone,
    I have some projects.
    An enterprise and war project created in netbeans.
    I would like to use some files from one project to another. when I import
    the package I get the error-
    'package x does not exist'
    I have added the package to the project but I still get the error.
    I have also added the project to import to my glasspath but still.
    E.g.
    set classpath
    .;c:\enterpriseA;
    My next idea is to create a war project into my enterprise project and copy the files
    from the war project into it in order to use it. But I'm sure there is a better way.
    THanking you in advance.
    eve
    Edited by: evepokua on Nov 22, 2009 1:44 PM

    One mistake I keep making is that I don't add the package to the
    Dependencies of the plugin I'm writing. You have to go to plugin.xml,
    and add the package you depend on to the Dependencies section. Maybe you
    didn't do this?
    Michael
    nasti wrote:
    > Hello everybody!
    > I am new user of osgi and eclipse. I tried to do some of Oscar examples
    > but I had some problems. Namely, the problem in import of package from
    > one project into another in Eclipse.
    > I add first project to the Build Path of the second one.
    > I add to the first project manifest line: Export-Package example2.service.
    > I add to the second project manifest line: Import-Package example2.service.
    > But when I tried to execute these bundles the
    > java.lang.NoClassDefFoundError was occurred. May be you will help me
    > with this problem.
    > Thanks....
    >
    >

  • Problem in IMPORTING!

    I have a problem with importing files.
    eg i have a file: Complex.java
    how can i use this file in another program (NR.java)??

    I have a problem with importing files.
    eg i have a file: Complex.java
    how can i use this file in another program
    (NR.java)??There are 2 ways of that purpose.
    1.If they are in the different and you hope you have your own function lib, you can define package in Complex.java, and import the package, that you can use this class.
    Example:
    if your CLASSPATH = .;E:\java;
    you must put you Complex.class in E:\java\mylib;
    //==== Complex.java ====//
    package mylib;
    public class Complex{
        public int add(int a, int b){ return (a+b); }
    //==== NR.java ====//
    import mylib.*;
    public class NR{
        public static void main(String[] args){
            Complex obj = new Complex();
            System.out.println("Sum is ",obj.add(1,2));
    }2.If they are in the same directory, you can use it directly without define package.
    Example:
    //==== Complex.java ====//
    public class Complex{
        public int add(int a, int b){ return (a+b); }
    //==== NR.java ====//
    public class NR{
        public static void main(String[] args){
            Complex obj = new Complex();
            System.out.println("Sum is ",obj.add(1,2));

  • Problem while import u201CSAPKU60003 & SAPKNA7013u201D into SAP CRM 2007

    Gentlemen,
    I have a problem while import u201CSAPKU60003 & SAPKNA7013u201D into SAP CRM 2007,
    My current Support Package Level is:
    SAP_ABA       700     0015
    SAP_BASIS     700     0015
    PI_BASIS      2006_1_700     0006
    ST-PI     2005_1_700     0006
    CRMUIF         600     0003
    SAP_BW       700     0017
    SAP_AP                700     0012
    BBPCRM                600     0002
    First I had the following error:
       Syslog: k CQ3 : UMGSETTING&                                          rscpexcc 12
       GetDBMigrateCodePagesLangs uses TCP0D, TCPDB, TCP0C.
         0 entries from FUNCT (%/SAPCND/CNF_GET_RECORD_FROM_DB%) deleted.
         0 d /   0 i /   0 u /   6 = 100% ucf FUPARAREF
         6 entries for FUPARAREF imported (/SAPCND/CNF_GET_RECORD_FROM_DBA*).
         0 entries from RODIR (FUNC/SAPCND/CNF_GET_RECORD_FROM_DB) deleted.
         0 entries from RODIR (FUNC/SAPCND/CNF_GET_RECORD_FROM_DB) deleted.
         0 d /   0 i /   0 u /   1 = 100% ucf TFTIT
         1 entry for TFTIT imported (D/SAPCND/CNF_GET_RECORD_FROM_DB*).
       successfully set a temporary lock on table REPOSRC
       REPOS /SAPCND/LDETERMINATION$14                A replaced.
       REPOS /SAPCND/LDETERMINATIONU14                A replaced.
        [dev trc     ,00000]  Wed Nov 26 16:33:14 2008                         1315447  8.171484
        [dbdsoci.    ,00000]  *** ERROR => invalid offset 0 for placeholder 16
                                                                                    71  8.171555
       unsuccessful statement: EXEC SQL: SELECT ID,OBJECT,LANGU,TYP,VERSION FROM DOKIL WHERE (LANGU IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
       dsql_open returned with unexpected error code 2
       Please contact the SAP support.
       End of Transport (0016).
       date&time: 26.11.2008 - 16:33:14
       5 warnings occured.
       3 errors occured.
       Main import
       End date and time : 20081126163314
       Ended with return code:  ===> 16 <===
    After I got this error I upgraded the Kernel from patch level 159 to 179,
    After that I restarted the update again but the system is still running on u201CIMPORT_PROPERu201D and dose not given any update,
    From Import logs of the queue I can see the following,
       Summary:
        24 DOCUT imported.
        16 DYNPS imported.
        30 DYNPT imported.
       387 REPOS imported.
        43 REPOT imported.
       Totally 505 Objects imported.
       Totally 3636 tabentries deleted.
       Totally 14 objects activated.
       Totally 12229 tabentries imported.
       62066888 bytes modified in database.
        [dev trc     ,00000]  Wed Nov 26 18:14:19 2008                         20996974  40.917838
        [dev trc     ,00000]  Disconnecting from ALL connections:                   30  40.917868
        [dev trc     ,00000]  Disconnecting from connection 0 ...                  287  40.918155
        [dev trc     ,00000]  Closing user session (con_hdl=0,svchp=00000000003005B8,usrhp=00000000002FB748)
                                                                                  5759  40.923914
        [dev trc     ,00000]  Detaching from DB Server (con_hdl=0,svchp=00000000003005B8,srvhp=00000000061530E8)
                                                                                    921  40.924835
        [dev trc     ,00000]  Now I'm disconnected from ORACLE                    8230  40.933065
        [dev trc     ,00000]  Disconnected from connection 0                        90  40.933155
        [dev trc     ,00000]  statistics db_con_commit (com_total=527, com_tx=307)
                                                                                    59  40.933214
        [dev trc     ,00000]  statistics db_con_rollback (roll_total=0, roll_tx=0)
                                                                                    52  40.933266
       Disconnected from database.
       End of Transport (0004).
       date&time: 26.11.2008 - 18:14:19
       2 warnings occured.
       Main import
       End date and time : 20081126181419
       Ended with return code:  ===> 4 <===
    Please advice me.
    Regards,
    Ahmed

    I have similar problem while updating support packages in SAP R/3 4.6C environment. 
    000 unsuccessful statement: EXEC SQL: SELECT ID,OBJECT,LANGU,TYP,VERSION FROM DOKIL WHERE (LANGU IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,
    000 dsql_open returned with unexpected error code 1                                                                             
    000 unsuccessful statement: EXEC SQL: SELECT ID,OBJECT,LANGU,TYP,VERSION FROM DOKIL WHERE (LANGU IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,
    000 dsql_open returned with unexpected error code 1                                                                             
    Here is an outline of series of events that happened:-
    We are applying in support packages in SAP R/3 4.6C HR Development
    (TFI) environment. We planned with installing all the SP stacks
    starting from 1 to 9.
    -Updated kernel, tp , r3trans and SPAM level to latest level.
    We received the following error in Import_Proper step of Support
    package upgrade. Though the step has been repeated after making sure
    that we have all the required files at OS level, we go this error
    repeatedly.
    Main import
    Transport request___: SAPKB46C52
    System______________: TFI
    tp path : tp
    Version and Release: 305.13.25 46D
    check-sum error in datafile after 9374854 bytes.
    Main import
    End date and time : 20081205192603
    Ended with return code: ===> 16 <===
    When we renamed Co-File & data_file at OS level to see if the files are
    created again and reran we got the following error.
    Main import
    Transport request___: SAPKB46C52
    System______________: TFI
    tp path : tp
    Version and Release: 305.13.24 46D
    Main import
    End date and time : 20081205185117
    Ended with return code: ===> 12 <===
    We tried importing the individual support package SAPKB46C52 from STMS
    and the transport cancelled at an earlier step with the same error.
    Dictionary import
    Transport request___: SAPKB46C52
    System______________: TFI
    tp path : tp
    Version and Release: 305.13.25 46D
    check-sum error in datafile after 9374854 bytes.
    Dictionary import
    End date and time : 20081205195929
    Ended with return code: ===> 16 <===
    While playing around I have deleted the transport from the tp buffer
    and added manually, before doing so I made a backup of tp buffer at OS
    level and I got following error though I reverted back to backed-up
    copy.
    - Error in phase: IMPORT_PROPER
    - Reason for error: TP_BUFFER_INCONSISTENCY
    - Return code: 0008
    - Error message: Wrong sequence of Packages in the tp buffer (e.g.
    SAPKB46C52 )
    I then tried to disassemble the package separately and reran the
    import queue. Now I have RC 8 on that support package.
    When I did R3trans -l on the datafile it completed successfully.
    D:\>R3trans -l \usr\sap\trans\data\RB46C52.SAP
    This is R3trans version 6.05 (release 46D - 27.10.08 - 16:32:00).
    R3trans finished (0000).
    I verified the size of file "CSR0120031469_0023301.PAT" and it is the
    same as mentioned in SSP.
    Let us know is there is a workaround.

  • Import package error in SAP BPC 4.1

    Hi,
    Can anyone please assist.
    I tried running the import package several times on bpc ver 4.1 without aby success. I even tripple checked Users and Security and it validated successfully but the package still crashes in the middle of processing.
    The error message read:
    [Package Result = Error]
    Package:                    Import
    Appset:                       CQS
    Application:                 FIXEDCOST
    Request Time:             2009-06-23 13:44:42
    Start   Time:                2009-06-23 13:44:42
    End     Time:               2009-06-23 13:48:51
    Total   Time:                00:04:09
    TOTAL STEPS  3
    1. Assign initial parameters:        completed  in 0 sec.
    2. Convert data:                     completed  in 7 sec.
    3. Load and process:                 Failed  in 241 sec.
    [Selection]
    FILE= DATAMANAGER\DATAFILES\CQSSA\2009\Fixed Costs Testnew.txt
    TRANSFORMATION= DATAMANAGER\TRANSFORMATIONFILES\CQSSA\FC_Trans_ZA_ACT.xls
    CLEARDATA= Yes
    RUNLOGIC= No
    [Member Selection]
    CATEGORY: ACTUAL
    ENTITY: SQSSA
    TIME: 2009.MAY
    [The list of conversion file in each transformation file]
    Transformation file: DATAMANAGER\TRANSFORMATIONFILES\CQSSA\FC_Trans_ZA_ACT.xls
         - Conversion file : ConversionFiles\CQSSA\FC_CONV_ZA.XLS!FCOSTACCOUNT
         - Conversion file : ConversionFiles\CQSSA\FC_CONV_ZA.XLS!FCOSTCENTRE
         - Conversion file : ConversionFiles\CQSSA\FC_CONV_ZA.XLS!MARKETS
    [Messages]
    FIXEDCOST
    Failed
    Submit Count  : 15278 (Record count in source file  : 20056)
    Accept Count : 0
    Reject Count : 15278
    You do not have WRITE authority.::ACTUAL
    Where can I enable WRITE authority?

    Hi Vishal Mahawadhi,
    Thank you for replying. I've tried all your suggestions before I even logged the query. I even went to analysis manager, gave access to the application and processed the cube but still that didn't help.
    But I noticed that I only have read access when I look at the settings on the roles in analysis manager. The problem is that I can't change the settings to read/write. Version 4.1 is a mess.

Maybe you are looking for