Package can't find other classes in package

Code Snippets:
**++++++++++++++++++++++++++++++++++++++++++++++
package fordsec;
// Imports
import java.sql.*;
import java.math.*;
public class AdminUsers {
public int createSingleUser() throws SQLException {
Connection tmpconn = null;
int cnt = 0;
try {
OraConn myconn = new OraConn();
**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Javac error
oracle@eccis72-LOGMON-> javac AdminUsers.java
AdminUsers.java:107: cannot resolve symbol
symbol : class OraConn
location: class fordsec.AdminUsers
OraConn myconn = new OraConn();
OraConn is in the package directory,
OraConn is a member of the package,
OraConn compiles ok,
OraConn as a default () constructor
It appears the AdminUsers Class is not importing the package and making the members available to this class.
Any Ideas (I hope this is simple)

When calling javac, you can pass it the exact diretctory and filename of class AdminUsers. But still it will not try and locate another class of the same package in that same directory, if it's not on the classpath - even if that class is assumed to be in the same package.
That means, the "base directory" should be included in the environment variable CLASSPATH or - if you use the -cp Option on the command prompt that starts javac, you should include it there.
In your case, this base directory would be the one containing the directory fordsec (which has the name of the package). Javac will find class OraConn in the fordsec subdirectory of ANY base directory listed in the classpath - it will merrily accept the first one (according to the sequence of directorynames in the classpath) that happens to contain a fordsec which contains an OraConn.
If it finds just the sourcefile OraConn.java, it will compile it first in order to produce OraConn.class in the directory where it found OraConn.java. If it already finds some OraConn.class anywhere on the classpath, it will not look for an OraConn.java; the compiler always verifies the existence of a referenced type by finding its .class file along the classpath (so if it cannot find or produce OraConn.class it cannot successfully compile AdminUsers either).

Similar Messages

  • Compiler can't find other classes

    I've got this bad problem that's been bugging me all weekend, and I can't work out how to fix it. A few months ago I was able to write classes that use other classes I've defined no problem. I just started using my compiler again, and now when I want to use different classes I've written, the compiler says that it can't find the other class:
    D:\uni\2005 Sem2\cse12ipj\assignment\HabitatModule.java:12: cannot find symbol
    symbol: class Module
    public class HabitatModule extends Module
    ^
    1 error
    Tool completed with exit code 1
    I've compiled the Module class and it doesn't have any errors. I'm guessing that there's something wrong with the classpath variable. Is that right? I'm using java 5.0.

    This is the base class. It compiles fine.
    public abstract class Module
    private char type;
    private String axisCode;
    private Module moduleList;
    abstract int getSpareCapacity();
    When I compile this next class, the compiler on my PC says that the class Module can't be found:
    D:\uni\2005 Sem2\cse12ipj\assignment\Habitat.java:12: cannot find symbol
    symbol: class Module
    public class Habitat extends Module
    ^
    1 error
    Tool completed with exit code 1
    public class Habitat extends Module
    private class Person
    private String name;
    private int id;
    private String speciality;
    private int maxPeople;
    private int nrPeople;
    private char subType;
    private Person personList;
    private String purpose;
    public Habitat(int maxPeople, char subType, String purpose)
    this.maxPeople = maxPeople;
    nrPeople = 0;
    this.subType = subType;
    this.purpose = purpose;
    public int getSpareCapacity()
    return maxPeople - nrPeople;
    If I compile it on any other machine, it's fine. I was looking on the web, and the CLASSPATH doesn't have to be changed for classes in the same directory.

  • Where can I find the quick install package for EBS extensions for Endeca?

    I want to install EBS extension for Oracle Endeca 12.1.3.4.
    Where can I find the quick install package in the edelivery.oracle.com site? Which Product Pack should I select in the site?

    If you're getting a "This update requires Mac OS X version 10.7" message, than you have the updater and not the full installer. Go to your Purchases section of the Mac App Store and you should see the full version there. But it may be 10.7.5, though in my system is shows as being from 2011 which would appear to be the original version.
    As to Mountain Lion, that's supported only on the Early 2008 Mac Pro or newer.
    Regards.

  • When updating itunes I get the message the install package can't find a file (itunes.msi) I've searched but can't find this file.  How do I install it?

    When updating itunes I get the message the install package can't find a file (itunes.msi) I've searched but can't find this file.  How do I install it?

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • 0FC_PAY in which support package Can I find it?

    Hello gurus!
    I need the 0FC_PAY datasource, for ISU , but I dont know in which support package can I find it?
    Somebody can helpme please
    Thanks a lot

    When logged onto ECC, go to menu option System > Status... In the section SAP System Data the component version field should provide you with the Enhancement Package, or EHP, level that you're at.
    To find the BI Content version, while in the System: Status screen, click on the magnifying glass next to the Component Version field. There should be a component called BI_CONT. That needs to have a minimum release of 704. The level, which is irrelevant for what you're looking for, is the Support Package level for that component.

  • My JSP can't find a class file

    Hi
    I am trying to view a JSP but I get ClassNotFoundException. I know that it means that it can't find the class but I can't understand why.
    my directory structure:
    Intranet->source
    ->jsp
    ->WEB-INF->classes->source-><class file here>
    first line of .java file:
    package source;
    JSP code:
    <%@page import="java.sql.*, source.*, java.util.*;" %>
    <jsp:useBean id="dbConnect" scope="session" class="source.DBConnect">
    <jsp:getProperty name="dbConnect" property="jdbc:odbc:Auto_Intranet" />
    </jsp:useBean>
    Must I create an environment variable for 'Windows': with classpath " .....\WEB-INF\classes"
    The Windows environment variable doesn't exist----using XP Pro

    Looks right to me.
    You don't need a classpath variable. Web containers ignore it anyway.
    Which class is not found? source.DBConnect?
    Is DBConnect in a package called source?
    Is your database driver in the web-inf/lib directory?
    Please post the full error message with stack trace - it will be easier to sort out.
    Good luck,
    evnafets

  • TOMCAT CAN�T FIND BEAN CLASSE

    Hello, i am from Argentina. i need URGENT help with tomcat, because i am developing my final thesis.
    I have all my sources in
    C:\jakarta-tomcat-5.0.16\webapps\tesis
    C:\jakarta-tomcat-5.0.16\webapps\tesis\ (archivos jsp)
    C:\jakarta-tomcat-5.0.16\webapps\tesis\lib
    C:\jakarta-tomcat-5.0.16\webapps\tesis\web-inf\classes\edu\tesis\beans
    C:\jakarta-tomcat-5.0.16\webapps\tesis\web-inf\classes\edu\tesis\queries
    C:\jakarta-tomcat-5.0.16\webapps\tesis\web-inf\classes\fede\servlets
    my problem is that when i execute the login.jsp through the browser in this way
    http://localhost:8080/tesis/login.jsp
    tomcat can�t find the edu.tesis.beans package
    In compiled jsp class i can see this
    package org.apache.jsp;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import edu.tesis.beans.*;
    so, the problem is that tomcat set package org.apache.jsp; to my jsp, so it can�t find edu.tesis.beans package.
    This is my context path that is in $CATALINA_HOME/conf/server.xml file
    <Context path="/tesis" docBase="C:\tomcat\webapps\tesis"
    debug="9"
    reloadable="true"
    crossContext="true"/>
    This is an extraction of my jsp file
    <html>
    <head>
    <%@page import="edu.tesis.beans.*"%>
    </head>
    <body>
    <jsp:useBean id="universidad" class="edu.tesis.beans.Universidad" scope="request" />
    <form action="servlets/fede.servlets.ServletMaxwell" method="post"><BR><BR><BR><BR>
    PLEASE, I NEED AN URGENT HELP!!!!
    THANKS,
    FEDERICO

    Tampoco te preocupes porque Tomcat cambie el paquete de las p�ginas jsp. Eso es un comportamiento normal. Adem�s nota que el paquete de tu tesis es importado en la clase generada a partir del jsp, o sea que deberia encontrarla si est� en el lugar correcto.
    Otra cosa que veo extra�a en tu estructura de directorios es que existe un directorio "lib" por fuera de WEB-INF. Si este contiene beans en forma de paquetes jar, deberia estar dentro de WEB-INF

  • Background callable object :  can not find this class name

    Hi All ,
                  I am following this tutorial link for creating background callable object
    http://help.sap.com/saphelp_nwce10/helpdata/en/9a/e8934258a5ca6ae10000000a155106/frameset.htm
    I have created java and enterprise application DC and deployed successfully. But while creating CO in design time when i am selecting application and entering class as com.examples.bckgco.UserDetailsCallableObject  for Implementation Class Name , and on click next i m getting exception as  "can not find this class name".       package and class name are correct still getting this excetpion message. Plz help me to resolve this solution.
    Regards
    Kavita

    Hi, kavita.
    First, make sure you choosed the correct container when you created the background CO.
    Second, make sure your package name was "com.examples.bckgco" and class name was "UserDetailsCallableObject". The exception  which you got just means you entered incorrect name.
    It doesn`t relate to your program.
    Best Regards.
    Louis Huang.

  • Can't find main class - program will end

    Dear forum readers,
    Recently upgraded from Win2k pro to XP pro .. installation ran to conclusion w/ no fatal errors BUT upon booting new system I now receive an error message "Java Virtual Machine Launcher can't find main class, program will end" .. I am not aware that this error is causing any problems BUT it is annoying and I'd like to be able to fix the problem so I don't have to close the error message at each startup .. please help!
    Thanks in advance, Larry

    Try this
    java -XbootClasspath/a -jar <<Prog name>>
    I think you are trying in windows XP.
    Also you need to modify if there are any other jars to be reference. For eg if a.jar is also required for this try as below
    java -XbootClasspath/a:a.jar -jar <<Prog name>>

  • Can't find textbox class - help please!

    I'm posting this again, in the hope that more people might help. I already know that the error means that the compiler can't find the class Textbox. I need to know why, because I've copied the relevant parts of the code from another app that builds fine. So why won't this build?
    I'm trying to write and build my first J2ME app. My code starts:
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import java.lang.Math;
    public class TestMIDlet
    extends MIDlet
    implements CommandListener
    private Textbox tbMain;
    public void startApp()
    The build fails with numerous errors of which the first is:
    C:\WTK22\apps\TestMIDlet\src\TestMIDlet.java:9: cannot find symbol
    symbol : class Textbox
    location: class TestMIDlet
    private Textbox tbMain;
    with the caret under the 'T' of Textbox
    I don't understand what's wrong with this, as it's in many of the sample apps I've looked at.
    Thanks
    Ed

    Thanks very much!
    I've lost count of the times I've been caught by that case-sensitivity thing in Javascript. I thought it was just the first letter that had to be capitalised. Progress at last!

  • Which Table, can I find the class and characteristic assigned to equipment.

    Hi all,
    I have assigned a characteristc to a class.
    And assigned this class to an equipment.
    Now in which table can i find the class assigned to this equipment.
    What is the logic to find the class and characteristic.
    Thanks in advance.
    Piyush

    Hi,
    As per above post, you can find classes. To find characteristics, Give EQUNR value in OBJEK field in AUSP table & get the ATINN value.
    Give ATINN value in ATINN field in CABN table & get ATNAM field value.
    In AUSP table, you can get the values against each characteristics as well.
    Regards,
    Maheswaran.
    Edited by: Maheswaran.K on Apr 19, 2011 9:28 AM

  • Installing 10g on Windows XP machine JVM launcher "Can't find main class"

    I am trying to install 10g Release 2 on a Windows XP machine. I downloaded the zip from the OTN. Unzipped the file. No problems. Tried to run the OUI, it opened up a shell and said to wait. The shell closed and a message frome the JVM Launcher displayed "Can't find main class. Program will exit." I have seen several people on this and other discussion boards having this problem, but have yet to get a solution. Please help.

    What's the value of CLASSPATH environment variable? Possibly a non-oracle application has set this variable and the installer catches it. If there is such a variable, comment it out and try again.

  • Can't find Java Class of a standard UI Command

    Hello everybody,
    Where can i find Java classe source and Bundle file of a standard UI Command "AppDetails"
    for example ?
    Thanks & Regards,
    Hassan Mounim

    Hi Hassan,
    You can find the UIDetailsCommand class here:
    ..\WEB_INF\portal\portalapps\com.sap.km.cm.ui.flex\private\lib\km.appl.ui.flex.uicommand_core.jar
    And the bundle file UIConst here:
    ..\WEB_INF\portal\portalapps\com.sap.km.cm.ui.flex\lib\km.shared.ui.flex.uicommand_api.jar
    Hope this helps,
    Robert

  • Swf can't find custom classes after publishing....

    Hi everyone,
    So this is probably an easy thing I don't know, I'm hoping.
    But when I publish my project and test it in a normal HTML, the swf can find some classes but not others for some reason?
    How can I make sure all the classes get compiled into the Swf?
    I got the main timeline calling the first class (CalypsoPlayer); and it finds this class find -- which is under the same class path.
    But CalypsoPlayer can't find the class it needs, even though it's under the same class path as the class.
    I've tested the project in Flash itself and it all works great without any errors so I'm not sure what's going on.  It's only when I test
    the published SWF that it can't find all the classes it needs.
    I appreciate anyones help -- Stan

    Hey Dan,
    My mind just stopped for an hour and I wasn't thinking straight on this issue, lol.  I thought I deleted this posting but apparently
    I didn't.
    Thanks for your help but this issue was just a result of a mind that had too much coffee and not enough energy .
    - Stan

  • Can not find Main Class - Can't Run Application

    I have at this for a while and it is drivng me crazy... I have an application that I want execute in a bat file. I have checked the runtime environment by executing java and javaw, both which give option on error messages. I have set the classpath to point too the class subdirectory. Here it is.., Every time I execute the bath file or execute the javaw command, I get the "Can not find main class" message.
    I am using XP ...
    Help please...
    Thanks for all your help.

    when you set the classpath I presume you mean that your running java or javaw as:
    javaw.exe -cp %classpath%;.;c:\library\myfiles com.mycomp.myapp.MainClassIf your using a jar then you must specify the jar in the class path.
    Don't presume it will find the jar. Other than that, you will have
    to provide more details.

Maybe you are looking for