Compile class in package that imports other package

hi,
i prepared two packages asume with name x_pck and y_pck.
a class in x_pck imports a class in y_pck. when i try to compile the class in x_package javac gives error such it can not find y_pck. so where do i have to put my packages to make javac see them?
thanks...

ok i found the solution.
i use javac with parameter "-classpath" such like:
javac -classpath path_of_y_pck path_of_class_in_x_pck

Similar Messages

  • Package that overwrite other packages

    I'm building a new package "mysqlclient" that will contain only the mysql client programs and libraries. Basically just run with configure option --without-server.
    Anyway, how does pacman handle a package that overwrites another package? For example if I install my new mysqlclient and then later install the official mysql package, what happens?

    ianneub wrote:
    Toth wrote:If you want to install the full mysql later on, you could always just remove mysqlclient, and then install mysql.
    Is it possible to check this from the package? Maybe it's better to just seperate the files from -client and -server so they don't overlap.
    I don't really see the point. If you want just the client, or just the server you can use ABS to compile it as you have done. Or just install all of mysql and only use the client.  If you want you can leave the client package named "mysql" and then just upgrade it to the standard package if you want both the client and server tools. Separating software into multiple packages just gets messy, IMO. There are some files that would be common to both, some that are only for the server, some that are only for the client. You'd end up with three packages: mysql-common, mysql-client, and mysql-server. Ugh. Just look at Debian's repositories sometime and you'll see why it's probably a better idea not to do it that way. Leaving it as a single package also makes it much easier to maintain.

  • JSP import self made Package that imports another self made package!

    I also posted under JSP section.
    I really need an answer please.
    Quite new to JSP & java. Not sure about how to use import properly for my problem below:
    Using Tomcat4.12 & jdsdk1.4 on WinXP
    So I create a package - lets call it p1.
    For all java files that belong to this packge I put on the top line of code:
    package p1;
    All files of package p1 are put in Tomcatdir\webapps\myapp\WEB-INF\classes\p1
    everything complies & the packge runs fine - theres a servlet in it & I'm happy.
    Now I create a new package to go with my webapp. Lets call this p2.
    However there is a java file in p2 that uses a class from p1 package.
    So in that file I put:
    import p1.theclassname;
    However this will not work because this line refers to:
    Tomcatdir\webapps\myapp\WEB-INF\classes\p2\p1
    so it will not find the class. Because its in:
    Tomcatdir\webapps\myapp\WEB-INF\classes\p1
    Anyway I can make it comple by moving files about & making a more complex dir structure & more complex package names - but this cant b the propler way to do it?????
    Anyway with my quick fix to this problem I cause a new porblem - in my jsp files that use both packages I cant import the classes I needas the are all complied in packages that are now in the worng place on the hard drive!
    I also tried doing this by just having p1 where it was to start with & then instead of making p2 - I'd just complie it in the classes folder & have it import p1. This works fine until I try to import the classes in JSP - I tried things like:
    <%@ page import=".*" %>
    but it doesnt work unless its in a packge like
    <%@ page import="p2.*" %>
    but if its in a package then the sturcture to the other packge is all wrong again!!!!!!!!
    I hope someone knows what I'm going on about.
    Please help me.

    you are answer izzaman's problemYes
    he has solve already,
    right?Well, I wasn't sure if he really solved it, or just found an ugly workaround, so I wanted to make sure it wasn't the latter.
    can you help me to clear me doubt also. I'm new
    to Java. my problem has been posted earlier....I don't know specifically how to fix your problem. It's probably a classpath issue, though it may also be some simple oversight like a misspelling or something. It's hard to say without more details. If it is a classpath issue, then whatever izzaman did may also work for you. I haven't done much with servlets and JSP lately, and when I have, I've never had classpath problems, so I don't know what kinds of issues are common there.
    I would suggest starting a new thread for your problem. That's generally what you should do anyway, and it will get more notice if it's in its own thread. Don't put it in Adanced Language Topics though. Put it in the JSP forum or Java Programming.
    Good Luck!

  • Importing other package java classes

    I am doing a webapp using Tomcat .I have some classes which i want to use in another webapp.I did set the PATH variable to point to the my first webapp classes directory .But it is still not bale to locate the classes.
    Does anyone have any idea.

    Learn how the Tomcat class loaders work and how to deploy Web apps properly.
    PATH doesn't affect Java at all. That's an OS environment variable. If you meant CLASSPATH, that'll do you no good, either, because Tomcat ignores any CLASSPATH environment variable.
    Read up on the Tomcat CLASSPATH. It's important.
    If you want both apps to use those .class files you have a few alternatives:
    (1) Put those classes in a JAR file and put that in the TOMCAT_HOME/common/lib directory.
    (2) Put those classes in a JAR file and put copies in the WEB-INF/lib directory for both apps.
    (3) Copy those .class files into the WEB-INF/classes directory for both apps.
    I'd prefer (2) myself.

  • How to import other package into Dictionaries in nwds web dynpro project

    Hi
        i'm learning JA312, in some topic, there need a method declaration in component controller, the method like this:
      public void showContext(IWDContext context),
       i can add method in method tab in component controller,but can not add parameter of IWDContext types,because in Dictionaries,there are only com.sap.ide.., and not include com.sap.tc.webdynpro.progmodel.api.
    so,how to import package into Dictionaries, for example com.sap.tc.webdynpro.progmodel.api.
    a step by step article is preferred. thank you

    choose "Java Native Type".

  • A package that "patches" another package

    I'd like to make a PKGBUILD for usb-rndis-lite v0.11. Usb-rndis-lite contains files that should replace some files from 'kernel26' package. Is it right when one package replaces files from another package? If so, what is the right way to do that?
    The point is that USB RNDIS driver, included in current 2.6.26 kernel is either outdated or buggy, so sometimes it needs to be replaced by SynCE's usb-rndis-lite. Unfortunately that driver is a part of kernel26 package and cannot be separately removed.

    Mr.Cat wrote:Nothing would prevent me from doing this, but that would be the "wrong way", I suppose. And you've mentioned one of the reasons - possible problems with correct package removal. Another problem I see - is that when kernel26 is updated - my package's files would be owerwritten.
    Exactly. Pretty ugly solution, although possible. In the install script, you can specify an uninstall function, so theoretically you can backup the original driver on install, and restore on uninstall, with a check if it hasn't been updated meanwhile.
    UPD:
    bender02 wrote:There's a special directory where you can put your patched/updated version of a driver, and then modprobe/insmod would load that new version, when the driver is requested.
    Thanks, worked for me.
    UPD:
    I've submitted a PKGBUILD for rndis-usb-lite (v0.11) to unsupported: http://aur.archlinux.org/packages.php?ID=20336.
    I'm glad it worked.

  • Package dependences block other packages

    After pacman -Syu I've got an error.
    :: thunderbird-spell-pl requires thunderbird=2.0.0.4
    From arch's site I knew about other fresh packages, so I've removed thunderbird-spell-pl and make pacman -Syu again. After that I was able to update:
    hunspell-1.1.8-1 opera-9.22-1 thunderbird-2.0.0.5-1 thunderbird-i18n-2.0.0.5-1 wine-0.9.41-1
    How can I make pacman update all packages (opera, wine etc.) bypassing those with dependencies conflicts (in my case thunderbird packages).
    "pacman -Syu --ignore" or adding package to ignore list in /etc/pacman.conf is not a solution.
    Last edited by qlus (2007-07-20 20:03:52)

    I don't want to make version conflicts.
    The case is clear. There is no new (2.0.0.5) version of thunderbird-spell-pl in repository. Could'nt just pacaman in that case skip updating: thunderbird and thunderbird-i18n to 2.0.0.5 (to prevent version conflicts) and update the rest?

  • Trouble with compiling class that contains "import com.sun.xacml.*;"

    I think the package com.sun.xacml is included in j2sdk 1.4.2 (the one that I have)
    but every time I try to compile a class that importes this package classes, the compiler dosen't recognize the package.
    It's a problem of updating the CLASSPATH?
    Thanks in advance

    I don't think this would be part of any standard java distribution.
    But I found a couple of jars (versions) available for download at
    http://ebxmlrr.sourceforge.net/maven/repository/xacml/jars/

  • Question about access non-public class from other package.

    Hi, everyone!
    Suppose class A and class B are in the same java file of package pkg1
    -- A.java. So, A is a public class and B is a non-public class.
    If I want to access class B from another class class C and class
    C is in package pkg2. When compiling, an error occurs indicating
    that class B is not visible to class C.
    So, If I defined serveral classes in one java file and I want to
    access every class from other package. How should I do?
    (I think in one java file, there should be only one public class and
    only the public class can be accessed from other package.)
    Thanks in advance,
    George

    So, If I defined serveral classes in one java file and
    I want to
    access every class from other package. How should I
    do? As you already seem to know, there is at most one public class allowed per source file (at least, with javac and most popular compilers). So if you want more than one public class, you will need to use more than one file...

  • Problem with importing jsp packages

    Hi guys. I'm having a problem compiling a class that imports jsp packages.
    I'm getting errors along the lines of:
    C:\>javac HelloTag.java
    HelloTag.java:4: package javax.servlet.jsp does not exist
    import javax.servlet.jsp.*;
    ^
    HelloTag.java:5: package javax.servlet.jsp.tagext does not exist
    import javax.servlet.jsp.tagext.*;
    - I've copied jsp-api.jar and servlet-api.jar to a folder that's in my path: C:\Program Files\Java\jre1.5.0_03\lib\ext
    Any suggestion?
    Thanks.

    U have to add the path into the classpath
    set CLASSPATH=%CLASSPATH%;jsp-api.jar ....
    the compile in the same cmd window
    Do not use the CLASSPATH environment variable. Use the -classpath option while compiling and specify the path to your jar file.
    javac -classpath <path to jar file> filename.javacheers,
    ram.

  • Import anonymous package ?

    Hi
    Im new here!
    How to import an anonymous package(without package packageName;)?
    i know where the classes are and the classpath is set to this dir. The packages which i want to import this classes are in sub-dirs of this dir.
    thank you
    jz
    (If you don't understand me please don't wonder 'cause i'm 13 and speaking german :) )

    How to import an anonymous package(without package
    packageName;)?
    i know where the classes are and the classpath is set
    to this dir. The packages which i want to import this
    classes are in sub-dirs of this dir.
    (If you don't understand me please don't wonder
    'cause i'm 13 and speaking german :) )Don't worry, you're doing more than fine. The technical stuff: you can't
    import classes from the default package and you shouldn't want to do
    that. Put all of your classes in the appropriate packages and import
    those packages (or single classes from those packages).
    If you insist of having a class in the default package, make it the single
    class with the 'main' method' that starts up the entire thing.
    kind regards,
    Jos

  • JAXB: XJC src-resolve error when importing other schemes

    Hi!
    I keep getting a src-resolve error from the JAXB binding compiler whenever I try to import other XML schemes into my own.
    For example:
    I want to use a SignatureType element as defined in the official XML signature schema.
    So I imported it into my own schema and use it as follows:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
    schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
    <xsd:complexType name="PayloadType">
    <xsd:sequence>
       <xsd:element name="signature" type="ds:SignatureType" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>However if I run XJC to compile my schema I get this error:
    [xjc] [ERROR] src-resolve: Cannot resolve the name 'ds:SignatureType' to a(n) 'type definition' component.I am using JAXB 2.0 EA from the JWSDP 2.0 and XJC is called from an Ant task.
    I am pretty new to JAXB and XML schemes, so any help on this topic would be greatly appreciated.

    I got the the answer from another forum; it was a proxy problem. Just to inform succeeding readers, here is what I did:
    To receive a better error output, I modified my ant buildfile to use the "nv" parameter:
    <xjc schema="${path}/.../mySchema.xsd" package="mySchemaPackage" destdir="${path}/.../src">
    <arg value="-nv" />
    <produces dir="${path}/.../src/mySchemaPackage" includes="**/*.java" />
    </xjc>Result:
    The XJC compiler gives me a different (better) error message:
    [xjc] [ERROR] java.net.ConnectException: Connection timed out: connectSo I looked in my Ant buildfile again to check the proxy settings. I merely used property-tags to define my proxy settings (<property name="http.proxyHost" value="nnn.nnn.nnn.nnn" /> and <property name="http.proxyPort" value="nnnn" /> ) which apparently do not work.
    Instead this here does the trick:
    <setproxy proxyhost="nnn.nnn.nnn.nnn" proxyport="nnnn"/>Good to now that "nv" might give you a better error report.

  • Package Visability in Sub-Packages

    Is there any way to make a class or interface visible to all the other classes in a package (package A) and any classes within a package that is within package A (package A.B, A.C, etc) but not visible outside of Package A?
    Kind of a package hierarchal visibility?
    Is this too way out for a JSR?

    There is no "package hierarchy". A.B is not related at all to A in the context of package names. A.B might just as well be treated as if it were named X.Y

  • View packages depending on selected package

    TL; DR: Is there a way to use pacman -Q to see what packages are depending on a particular package?
    Basically what's in the title.
    I'm always worried about removing packages in Arch here because I don't want to break (an)other package(s).
    I have made a file named "dependencies" that lists the dependencies selected by pacman for each package I've installed from the beginning, however it's not necessarily in chronological order, and you know that if you already have a particular package that a new package you're looking to install depends on, it won't tell you it's a dependency, because it's already there!
    I'm looking to remove avant-window-navigator and any useless packages left behind, if it matters.

    > pacman -Qi glibc
    Name : glibc
    Version : 2.12.1-2
    URL : http://www.gnu.org/software/libc
    Licenses : GPL LGPL
    Groups : base
    Provides : None
    Depends On : linux-api-headers>=2.6.34 tzdata
    Optional Deps : None
    Required By : a52dec aalib alsa-lib attr audiofile bash bash3
    binutils bison bzip2 cabextract calc cdparanoia
    coreutils cracklib dcron device-mapper dhcpcd diffutils
    dmidecode eject elfutils eventlog expat faac fakeroot
    file findutils flac flex foomatic-filters fuse gawk
    So that tells you which package need another package.   Pacman won't let you remove a package unless that list is empty anyway.
    Read the man page for details on how to remove a package and all its dependencies.

  • Can we initiate a class without extending or importing that class or packag

    Can we invoke a class
    class dog
    public static void main(String args[])
    Animal a = new Aniamal();
    like this without extending or importing the package belongs to animal.

    Can we invoke a class
    class dog
    public static void main(String args[])
    Animal a = new Aniamal();
    like this without extending or importing the package
    belongs to animal.give it the package location
    class dog
      public static void main(String args[])
        org.mypackage.Animal a = new org.mypackage.Animal();
    }

Maybe you are looking for

  • Thunderbolt port

    My thunderbolt port is being HOT and the external hard drive doesn't work with this port! Can anybody help me?

  • JDBC Reciever issue with Place Holders

    Hi, I am working with Idoc to JDBC scenario. Where the table field names contains $ value in it. Example: T$value1, T$value2,T$valuse3 and ... so on. The special characters would not be accepted in datatype elements in XI. I found some details workin

  • Facing problem while making http request?

    Hi Friends,    I have made blackberry application. I am able to download the same using OTA successfully. With the help of this application I am trying to communicate to server using Httpconnection and want to get some response from server. It is wor

  • GarageBand - Controller's Foot Pedal (in AUSampler) works for one track but not for another

    I am learning how to use AUSampler in GarageBand. I am using a MIDI controller (Alesis Q88) with a foot pedal for the sustain. The sustain works with the default sound in AUSampler (Sine 440), but not for a sound that I imported. Also, my imported so

  • Head phone jack broken?

    i have a 60gb and have noticed my right side of my head phones has stopped working. i thought it was the new headphones, but tried other pairs and got the same thing. Also tried the headphones on another ipod and they work fine. any one know what is