Complier can't find my class!

I created 'class a' and try to import it to 'class b' using the statement "import a;".
class a and b are in the same directory (say c:\mypro) under win98
When I try to compile it using javac.exe it gives me an error like:
b.java:1: '.' expected
import a;
^
I tried setting the classpath (set classpath=c:\mypro) but it doesn't work. Please help!

I think jdk1.3 is the only version that allows you to import from the default package. So I am guessing you are using 1.4. In order to import a class from another class, the class you want to import must be in a package (not the default package). If both classes are in the default package, you don't need to import, but you do need the directory that contains the classes to be in the classpath.

Similar Messages

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

  • 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

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

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

  • How can I find these classes---please!!

    where can I find these classes
    com.sun.media.protocol.dsound.*
    com.sun.media.protocol.sunvideo.*
    they are needed in a JMF program.

    Generally speaking, sun classes are for internal use only. That's not to say you can't call things in those classes, but documentation is hard to come by if at all.

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

  • FindClass can't find a class. need  HELP.

    In my C++ code,
    JavaVMOption options[2];
    JavaVMInitArgs vmArgs;
    options[0].optionString=(char*)"-Djava.class.path=/javahome/V1.3/lib/dt.jar:/javahome/V1.3/lib/tools.jar:/javahome/V1.3/jre/lib/rt.jar:/javahome/V1.3/jre/lib/i18n.jar:/myapps/lib/myLib.jar";
    options[1].optionString = (char *) "-Djava.compiler=NONE";
    vmArgs.version=JNI_VERSION_1_2;
    vmArgs.options=options;
    vmArgs.nOptions=2;
    vmArgs.ignoreUnrecognized=JNI_FALSE;
    JNI_CreateJavaVM( &jvm, (void**)&ev, &vmArgs ));
    if(env->FindClass(my_apple_class)==NULL)
    fprintf(stderr, "Can't find my_apple_class !\n");
    else
    fprintf(stderr,"Found my_apple_class! \n");
    my_apple_class is in /myapps/lib/myLib.jar
    I am getting "Can't find my_apple_class!".
    Would anyone please explain to me why ?
    Thanks,
    --- Won k.

    I am getting "Can't find my_apple_class!".
    Would anyone please explain to me why ?The simple answer is because that it does not exist in the classpath.
    Since you neglected to tell us what the fully qualified class name is of the class that you are trying to load, as well as the value of the my_apple_class variable, it is impossible to say what the root of the problem is.

Maybe you are looking for

  • I need to clean my Desktop Backgraund from pictures-mistakes made by me

    Sorry:I made a mistakeand right now screen my PC full over all icons one of INFO from my scanner. What i must do for Delite this piucture?

  • Best way to dynamically load an action controller?

    Say all requests go through a front controller. The front controller delegates that request to a particular action controller. The name of the controller, and the name of the action comes from the URL. What's the cleanest way to get an instance of th

  • How do I browse the Lation section by Genre

    In the previous version's of Itunes(Before Itunes 9) under music there was Latino and then groups such as Reggaetton y Hip-Hop, Pop Latino, Salsa y Tropical etc.. How can you see the latest new releases of these now? It is all just big section called

  • Does mountain lion run on iMac 10 1 hard drive

    I have an iMac 10 1 that needs a new hard drive. It is currently running OS 10.6.8. I'm trying to decide whether to replace the hard drive, which is failing, or to just replace the machine. Key consideration is whether I can get this computer to run

  • Greatest Hits Albums

    When I go into Cover Flow and select a song in a Greatest Hits Album, it show's all the songs from that Artist and all the other Artist's with Greatest Hits. I don't want to change the name of the CD and have to find and then paste the Album Art beca