Again classpath problem

again classpath problem.... i have tried to solve it in many ways but all failed. here is one
instance of my effort which did not give me success.
i have a FOLDER > c:/com/abc/def/ijk
and files......
MyClass.java
==============
package com.abc.def.ijk
class MyClass
// blah
// blah
}c:\com\abc\def\ijk>javac MyClass.java ===>compiled fine and created a class file.
and also one more file.....
OneMoreClass.java
=================
import com.abc.def.ijk.MyClass
class OneMoreClass
// blah
// blah
}c:\com\abc\def\ijk>javac OneMoreClass.java ===> Error!!! package com.abc.def.ijk does not exist !!!!
how can i solve it ?

yea, this works....eariler i also usued to do this
way. but this time i forgot.
by the way, why individually it did not work !!!.Because you were in the package directory itself, and the classpath was set to the cwd, so java was looking for package directories at this level.
and also when i specify directly by
c:\com\abc\def\ijk
javac  -classpath c:\com\abc\def\ijk\MyClass
OneMoreClass.java ...it does not work!!.
STRANGE! why ?Because by stating the package directory as classpath, you do the same as explained above. Stay out of package directories, stay one level above them, don't regard them as common directories. When declaring classpaths, don't mention package directories but the directories that contain them.

Similar Messages

  • Another simple classpath problem question

    Hi All
    Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
    I have a simple program:
    public class prueba {
            public static void main(String[] args) {
                    System.out.println("Ahi va...");
    }placed in /tmp/javier/prueba.java
    After compiled, I've tried to run it from / and then problems started:
    cd /
    java /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    I said, ok...it could be a classpath problem...then:
    java -cp /tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
    Damn, another try...
    java -cp .:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Jesus Christ....may be the last slash....
    java -cp .:/tmp/javier /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Oh...no.... may be classpath to java classes..
    java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Well, I don't know why this error happens....
    Please, could somebody help me !!!
    Thanks in advance...
    <jl>

    It's not too early to start following the Sun coding
    conventions for Java:
    http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
    tmlHi
    thanks for your reply.
    Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
    Let me know if that works. (It was fine on my
    machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
    Thanks again...

  • Hello I am in Afghanistan i searched that in realtek but that told me you coulde not use this sit   I writ again my problem    i installed win 7 32 bit in my mac pro 13-inch, Late 2011  Processor  2.4 GHz Intel Core i5

    On Thu, Jun 14, 2012 at 12:54 PM, mahdi ehsani <[email protected]> wrote:
    On Sun, Jun 10, 2012 at 7:29 PM, Apple Support Communities Updates <[email protected]> wrote:
    Apple Support Communities
    Re: after install windows 7 32 bit there is no sound my mac is os x 10.7.2
    created by The hatter in Boot Camp - View the full discussion
    This solved my question 
    This helped me
    you have RealTek on your workstation and just download the current driver which is easy to findwww.realtek.com
    This solved my question 
    This helped me
    Did this help? Go to the message, sign in, and reply or mark the response as correct or helpful
    Start a new discussion in the same community/choose-container!input.jspa?contentType=1&containerType=14&container=2143&ac_ci d=op123456
    You are receiving this email from Apple Support Communities. You can change your email preferences in your Apple Support Communities Profile.
    © 2012 Apple Inc. 1 Infinite Loop, MS 303-3DM, Cupertino, CA 95014.
    All Rights Reserved | Privacy Policy | Apple Support Communities Terms of Use | Apple Support
    hello I am in Afghanistan i searched that in realtek but that told me you coulde not use this sit 
    I writ again my problem  
    i installed win 7 32 bit in my mac pro 13-inch, Late 2011  Processor  2.4 GHz Intel Core i5   Software  Mac OS X Lion 10.7.2 (11C74) 
    but there is no sound in windows 7  please send me a address sit for downoad driver that i can use in Afghanistan 
    believe it is confus me and other friend that bought 5 mac's that are the same and i serched a lot of site without result
    please help us by address site please please .....
    <Edited by Host>

    hello I am in Afghanistan i searched that in realtek but that told me you coulde not use this sit
    I writ again my problem 
    i installed win 7 32 bit in my mac pro 13-inch, Late 2011  Processor  2.4 GHz Intel Core i5   Software  Mac OS X Lion 10.7.2 (11C74)
    but there is no sound in windows 7  please send me a address sit for downoad driver that i can use in Afghanistan
    believe it is confus me and other friend that bought 5 mac's that are the same and i serched a lot of site without result

  • Classpath problem

    i am here stuck..
    my dir structure is
    c:\my\xxx\yyy\zzz
    i have a code ...
    package xxx.yyy.zzz;
    class A
    // some code
    }i have compiled sucessfully and put the clsss file into c:\my\xxx\yyy\zzz folder.
    now i want to import it in another class
    like...
    package xxx.yyy; // note this
    import xxx.yyy.zzz.*; // note this
    class B
    // some code
    // creating instance of class A here
    }question is how do i compile and run it ?
    i am at c:\my---> what should be the command to compile and run the above code?
    plz give me the explicit command so that i can test and verify . i have given the dir structure.
    i have tried several ways but got class not found exception and errors . i know its a classpath problem but i could not figure out what should i type at the c:\my prompt.
    can u give exact command to run and compile the above code in steps ?
    thanx

    question is how do i compile and run it ?You don't with that code. You've defined class A to have "package visibility," meaning it can't be used from outside its package. You should declare it with public visibility instead, like "public class A {...".
    Once you change that, use these commands to compile and run:c:\my\>javac xxx/yyy/zzz/A.java
    c:\my\>javac xxx/yyy/B.java
    c:\my\>java xxx.yyy.B

  • Classpath Problem (Using JSAPI)

    Hi,
    I using IBM Via Voice as a the implementation of the JSAPI on my system. I've downloaded the speech for java pack from IBM Alphaworks and put it in the directory of
    c:\ibmjs
    This gives you access to the speech packages for utilisation in your programs so I should be able to import javax.speech in my programs. However the system doesn't see these classes.
    Heres my Autoexec...
    path=%path%;c:\jdk1.3.1_01\bin;c:\ibmjs\lib;
    CLASSPATH=%CLASSPATH%;c:\ibmjs\lib\ibmjs.jar;
    I presume the whole thing is just a classpath problem, does anybody have any idea from the above paths where I am going wrong?

    i guess you have to put some of ibm's dll files coming with speech for java in the path (not classpath). it's not sufficient to have the directories in the path.
    anyway, there come's an installation manual with speech for java which explaines all that.

  • Fragment Bundle Classpath problems

    Does anyone have any tips for solving classpath problems in fragment bundles? I'm getting a no-class-def that I can't explain.
    I've used maven to create a fragment, hosted by com.day.crx.sling.server, to create a custom login. It needs to call a web service, so I've included httpclient-4.2.3.jar. I can see this jar listed on the deployed fragment's Bundle-ClassPath, via the osgi>bundle console. When I inspect the bundle that maven created, I can find this jar contained in the bundle jar, in the directory specified in the Bundle-ClassPath. I even oppened the httpclient jar to ensure that the offending class (org/apache/http/client/HttpClient) is there.
    This is the first fragment that I've tried to build. Is there something I don't know about how they load classes?
    Does anyone have any tips or tricks on solving osgi classpath problems? I read that felix has some tools, but I haven't found any documentation about them.

    I'm still not sure why the classes didn't load, but I have a solution to my problem - don't try to include the jars in the fragment bundle. I tracked down osgi-ready versions of the libraries that I needed and and installed them.

  • I have problem " verify your emal "   i can't change account , i removed application and instell again , same problem fix email and " verify email"

    i have problem " verify your emal "   i can't change account , i removed application and instell again , same problem fix email and " verify email"

    The Email ID provided here has CC registered to it in active status. The Email also stands verified. Are you using any other Email ID ?
    Let me know if you are facing issue regarding verification by activating the Cc with the email ID provided here.
    Regards
    Rajshree

  • Classpath problems in EAR packaging?

    I try to access an EJB from a JSP. The JSP resides in web.war and the bean is in ejb.jar, and both of these are packaged together in an ear.
    I get a compile error when I try opening a JSP. I've had this problem in all my attempts to use my bean classes from JSP.
    My browser reports that the compiler cannot find the beans package. I have servlets within the war-file that are able to find the beans package, but the JSPs aren't.
    My ear-file contains 3 files
    ejb.jar
    web.war
    META-INF\MANIFEST.MF
    The manifest classpath points to ejb.jar and web.war
    My guess is that this has something to do with the way this is deployed by GlassFish.
    The application is deployed in the
    domains\mydomain\applications\j2ee-apps\myear\
    This directory contains the expanded files:
    ejb_jar\
    web_war\
    META-INF
    So the Java classes under web_war\ are able to see the Java classes under ejb_jar\ (i.e. my servlets)
    However; when GlassFish creates Java files from the JSPs and then tries to compile them, these files are placed under
    domains\mydomain\generated\jsp\j2ee-apps\myear\web_war\org\apache\jsp\jsp
    This might be correct for all I know, but apparently the compiler is unable to find the Java classes located under the mydomain\applications\.. directory when compiling classes located under the mydomain\generated\.. directory. There are no other files from my ear anywhere in the "generated" directory.
    So to me this seems to be some kind of classpath problem, as the compiler cannot find the needed files.
    Does this make any sense to anyone?
    PS
    In my ear, the JSPs are placed in the web.war. The war file looks like this:
    jsp\
       myjsp.jsp
    META-INF
       MANIFEST.MF
    WEB-INF
       web.xml
       lib\
          mylib.jarThanks
    \\Marius

    Marius,
    If you want communicate the bean you have to do following things.
    . Create a factory for the correct protocol
    . Obtain a Home
    . Use the Home to create stubs to the remote object
    So you want to call the Home and Remote interfaces to access the bean. When you run the client program, it will create the remote object that time it has to search the Home and Remote interfaces. So you have included those files for references in following location
    WEB-INF/classes
         -- <Home Interface File Name>.class
         -- <Remote Interface File Name>.class
    Or
    WEB-INF/lib
         -- <Bean Jar file name>.jar
    I think you will understand.
    -Mani

  • Again same problem error 0xE8000003 pls help again i don't know it keep doing that

    Again same problem error 0xE8000003 pls help again i don't know it keep doing that please help with that

    Hello sartip fatah,
    The following article provides further information regarding this error, and steps to help resolve it.
    iOS: Unknown error containing '0xE' when connecting to a Windows PC
    http://support.apple.com/kb/TS3221
    Cheers,
    Allen

  • JDBC and Classpath problems on OpenVMS

    Hello,
    I'm working on an OpenVMS server and I got a simpler Java application that needs to establish a connection to an Oracle database, the application works perfectly well on Windows but when I moved to OpenVMS I got some problems with the oracle driver.
    I believe I�m using the correct driver, I already checked on the oracle site according to my java version (1.4.2) and my database version (oracle 9i 9.2.0.7.0)
    This is the error:
    $java -jar miss.jar "DnBProcess"
    About to start loading parameters for the MISS Proxy.
    Successfully load parameters for the MISS Proxy.
    About to load interface settings for DnBProcess
    Settings for DnBProcess succesffully loaded.
    About to load interface DnBProcess
    About to start loading parameters for DnB Interface.
    Successfully load parameters for DnB Interface.
    Interface DnBProcess succesffully loaded.
    About to execute interface DnBProcess
    Connecting to the database...
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
    at miss.DnBProcess.ExecuteQueryToFile(DnBProcess.java:85)
    at miss.DnBProcess.Execute(DnBProcess.java:178)
    at miss.Proxy.ExecuteInterface(Proxy.java:160)
    at miss.Proxy.main(Proxy.java:207)
    I know is a classpath problem, and my classpath on VMS looks like this:
    define JAVA$CLASSPATH .,SYS$COMMON:[JAVA$142.LIB]TOOLS.JAR,SYS$COMMON:[JAVA$142.LIB]DT.JAR,SYS$COMMON:[JAVA$142.JRE.LIB]RT.JAR, USER1:[MONTEALEGRE.TEST.LIBS]OJDBC14.JAR,USER1:[MONTEALEGRE.TEST.MISS.LIBS]OJDBC14.JAR,[]
    As you can see I added the �ojdbc14.jar� in different folders but my application seems not to find it.
    Does anyone know how to set the classpath properly on VMS? Or maybe give me some tips that could lead me to find a solution to this problem.
    Thanks.
    Ileana.

    I would try googling for OpenVMS classpath. Unfortunatley the first result is this thread but there are a bunch of resources from IBM and HP listed and maybe they can help you.

  • Help classpath problem j2sdk1.4.2_04

    help classpath problem j2sdk1.4.2_04
    how can i run the java program with specify the file location
    such as :
    -----this one is fine ok and return HelloWorld.class-----
    [root@localhost root]javac /serverData/studentAC/s001/HelloWorld.java
    -----but this one cause exception-----
    [root@localhost root]java /serverData/studentAC/s001/HelloWorld
    -----result-----
    Exception in thred "main" java.lang.NoClassDefFoundError: /serverData/studentAC/s001/HelloWorld
    [root@localhost root]
    I have tried a lot of classpath setting:
    I just want to compile and run the java program without specify the classpath only !! please help !!! and give suggest !! if you have this exp!!
    # ---1
    #PATH=/usr/java/j2sdk1.4.2_04/bin:$PATH:$HOME/bin:./
    #export PATH
    #export JAVA_HOME=/usr/java/j2sdk1.4.2_04/
    #export #CLASSPATH=/usr/java/j2sdk1.4.2_04/lib/tools.jar:/usr/java/j2sdk1.4.2_04/jre/lib/rt.jar:./
    # ---2
    #set java environment
    # Java Setup Section START
    export JAVA_HOME="/usr/java/j2sdk1.4.2_04"
    export JRE="$JAVA_HOME/jre"
    export CLASSPATH="$JAVA_HOME/lib:$JRE/lib:$JAVA_HOME/lib/tools.jar:."
    export PATH="$PATH:$JAVA_HOME/bin"
    # Java Setup Section END
    # ---3
    #PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
    #JAVA_HOME=/usr/java/j2sdk1.4.2_04/
    #export PATH
    # ---4
    # Java Setup Section START
    #JAVA_HOME=/usr/java/j2sdk1.4.2_04
    #export JAVA_HOME
    #CLASSPATH=$CLASSPATH:/usr/java/j2sdk1.4.2_04/lib:/usr/java/j2sdk1.4.2_04/jre/lib:./
    #export CLASSPATH
    #PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
    #export PATH
    # Java Setup Section END
    # ---5
    #export PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin
    #export JAVA_HOME=/usr/java/j2sdk1.4.2_04
    #export CLASSPATH=/usr/java/j2sdk1.4.2_04/lib:$CLASSPATH:.
    # ---6
    #====================================================
    #export JAVA_HOME=/usr/java/j2sdk1.4.2_04
    #export PATH=$JAVA_HOME/bin:$PATH
    #export CLASSPATH=/usr/java/j2sdk1.4.2_04/lib:$CLASSPATH
    #====================================================

    I think this will work. java -classpath /serverData/studentAC/s001 HelloWorld

  • Servicegen classpath problem

    I'm trying to find out the status of the servicegen classloading problem
    (specifying a classpath in a servicegen task causes class cast exceptions).
    We are currently using the workaround described in this group which is
    putting the weblogic jars in the system classpath. This workaround is very
    unwieldy in our build environment. Is there any estimate on when the
    problem will be fixed?

    And was it? I am using 7.0sp4 and am getting classpath problems in servicegen.
    The problem I am having is that the type generation fails to find any of the weblogic
    utility classes, sug as weblogic.xml.schema.binding.util.runtime.PropertyInfo
    (and many many others)
    "Neal Yin" <[email protected]> wrote:
    This will be fixed in 7.0sp3 and 8.1sp1.
    Thanks,
    -Neal
    "John Horner" <[email protected]> wrote in message
    news:[email protected]..
    I'm trying to find out the status of the servicegen classloading problem
    (specifying a classpath in a servicegen task causes class castexceptions).
    We are currently using the workaround described in this group whichis
    putting the weblogic jars in the system classpath. This workaroundis
    very
    unwieldy in our build environment. Is there any estimate on when the
    problem will be fixed?

  • Jar file and classpath problem

    I0m writing a program that use the kunststoff.jar Look&Feel.
    Now I would like to put all I'm writing into a jar file but I always have a NoClassFoundException when I try to start my application.
    here is a MANIFEST:ME I'm using:
    Manifest-Version: 1.0
    Created-By: 1.4.2-beta (Sun Microsystems Inc.)
    Main-Class: JListaR.JListaR
    Class-Path: kunststoff.jar img\ .why this don't work?

    Unfortunately you can't embed jars within a jar and
    expect them to be referencable for the classpath from
    outside the main jar. The "Class-Path" attribute in
    the manifest is used to refer to other jar files
    outside of your jar file.
    The usual approach to solve this problem is to unpack
    the jar files you want to embed and then rejar
    everything together in one big jar file again. This
    isn't always a great approach though, I know I'm
    looking for an alternative. So far my only alternative
    is dynamic class loading using a classloader, however
    this isn't great if you need to refer to several
    hundreds or even thousands of classes.thank you very mach...now I understand because it dosen't work correctly!

  • Maybe a classpath problem

    I have a GUI that calls another .class file. On my machine it compiles and runs fine. I put all the .class files in a folder with all dependencies and constructed the following batch file -
    path C:\oracle\ora92\bin;C:\Sun\AppServer\jdk\bin;
    ::C:\oracle\ora92\bin;
    ::C:\Sun\AppServer\jdk\bin;
    javac TGui.java
    java -classpath . TGui
    pause
    I have the user change the path to the oracle and java folders as well.
    The problem is I get a "cannot resolve symbol" error when I try to run the batch file on a different machine.
    (I have the javac because the other computer runs 1.4.2 where as it was developed with 1.5.0_06)
    Any ideas, Thanks
    p_snipe

    That's a good point...hope this helps
    TGui.java:56: cannot resolve symbol
    symbol    : class WindowDestroyer
    location  : class TGui
                         addWindowListener(new WindowDestroyer());
                                                ^Like I said before, this works fine on my machine. I'm just copying the folder and moving it to another machine.
    Thanks again,
    p_snipe

  • Here we go again,....iTunes update for Windows 7 fails again same problem as back in Feb update

    Why is it that Apple is failing to get it right lately with their updates?
    Tried to install latest iTunes for Windows update on my PC Win 7 and it fails again wioth same error messages as with the previous update in Febr.
    Sooo very disappointed!!!!!
    To go thru all this again is taking me a few hours again to fix this problem assuming it works again this time, maybe I should just give up on iTunes instead.
    Troubleshooting issues with iTunes for Windows updates
    really *****,
    NE1 have any suggestions for an easy fix?
    thanks

    First off the automatic install fails nothing happens.
    Then tried the manual install after download, get the message that Apple mobile service failed to start and make sure i have required privileges to do so(Total BS)
    the SetupAdmin.exe file does not provide any action.
    Then right clicked the iTunes6464.msi file and installed it. Seems to install the update but when iTunes starts get the: "error 7" msg with iTunes helper was not installed correctly. Please reinstall iTunes. then w're in that **** loop......LOL
    I believe this is because I have a 4 yr old laptop with old graphic card.

Maybe you are looking for

  • After Migrating from 10g to 11g Geeting problems with Guided navigations.

    After Migrating from 10g to 11g Geeting problems with Guided navigations and section navigations not working. And we are getting the following error <<odbc driver returned an error (SQLExecDirectW)>> where we have used navigations. In 10G we have Gui

  • Can't save or publish and other issues

    Aaaahhh.... I need help. I love iweb because of how easily you can just fill in the blanks and drag and drop things, but it is constantly going crazy on me. Here is my latest issue: 1. When I try to save I get this message "Save Failed Too many open

  • Deck won't recognize Final Cut

    I see I'm not the only person to have this problem, but I've seen no good solutions. I'm using a 9-pin FireWire to connect a Sony DV deck, but Final Cut won't read it. I've also tried with a Sony camcorder with the same result. Could it be a problem

  • Mac book pro turning on problems?

    hi there my macbook pro has stopped working. all it does at the moment is whilst chargering the green light is on the charger. Also when you hold down the battery indicator button is just flashes with one light and goes off. i ve left it on charger f

  • U2 album showing purchased but can't download on my iPhone

    When I go on iTunes the album shows purchased but I can't find it ANYWHERE on my phone.  I'm aware of the fixes from my desktop but I haven't seen any to download it on my phone (I'm not near my desktop). Thanks