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.

Similar Messages

  • Java server page compiler can not find a class defined in a java bean file

    I have a jsp file using java bean. The java bean class file is uploaded into the server and also the directory to this java bean .class file is included in the Unix environment CLASSPATH. This .jsp file is registered and should be compiled and excecuted automatically.
    WHen I try to invoke this .jsp file, the jsp compiler error, saying the class defined by java bean can not be found. I already include this path in teh CLASSPATH, I thought the jsp compiler will go to the right place according to CLASSPATH to find the referenced class.
    Can anyone tell me what I have done wrong or what should I do in order to allow jsp compiler to find the class refrenced by .jsp file and defined by java bean file?
    Thank you so much

    hello friends,
    i am also facing the same problem of not finding bean class files for both jsp and servlet though it is placed in same package. the problem of not finding bean class file for jsp is experienced in Tomcat server only whereas in Blazix, there is no such error and the file is compiled and runs successfully.
    i have checked Tomcat properly. there is no error in its configuration also servlets without the use of bean files run successfully. so please can anybody guide me about what is the problem and how to solve it. plz its urgent .

  • 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).

  • 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!

  • Servlet compilation - where to find the class files ?

    Hi !
    I am new to servlets and I have just downloaded Tomcat 4. I think that a servlet has to extend the HttpServlet class and throws a ServletException exception, right ? But where can I find these classes for Tomcat (I think that these don't ship with it !). I tryed to fix the problem by downloading these classes for JSDK but the Tomcat examples (which I could run) did not compile !...
    It is perhaps a silly question, but could someone help me out ?
    Thank you

    There is a package called servlet 2.3 wich contains all the classe you need to create servlets, you can download it from
    http://java.sun.com/products/servlet/download.html

  • 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'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>>

  • 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

  • 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

  • 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.

  • Where can I find SafeZipFileInputStream class in weblogic 10.3

    Hi ,
    I am migrating my application from weblogic8.1 to weblogic 10.3. In my application I used SafeZipFileInputStream.class , this class is placed in weblogic.jar file.
    In weblogic 10.3 SafeZipFileInputStream.class is not in weblogic.jar file.
    Can anyone help me where can i find this class.
    Thanks in advance.
    Sha.

    It is under modules directory, look for modules\com.bea.core.utils.full_1.4.0.0.jar or modules\com.bea.core.utils_1.4.0.0.jar

  • 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 NOT FIND MAIN CLASS

    Why after i have unzipped and edited the classes in the jar file and zipped them together again, it gives me the message "CAN NOT FIND MAIN CLASS"?
    This is after i have edited any class in the .jar zip.I did not edit the Manifest text file,can someone who has experienced this problem show me how to overcome it.
    Thank you.

    i think you have to read the "java tutorial on Jar files".
    i guess after you have exracted the .jar file then you've edited the ".class"(i dont know how you did it) but i think you mean ".java" you should create another .jar file to be able to reflect the changes you have made, then set the main-class attribute of the newly created .jar file.

Maybe you are looking for