How to import a .class in eclipse?

I have a .class file w/ out the source, and im tiring to import that into my project.
So I go to import->File System and check the .class file. It shows up in my project but when I try to instantiate it I get a "can not be instantiated to a type" error.
any thoughts?
this is happening to a lot of people in my course.
thanks!

Hi,
i tried that what you sad, but my eclipse can't import that class.
So: I have eclipse 3.1, and i would like to import a class (without source). I develop at the moment a J2ME project with eclipse.
The class what i want to import is in a package, so i must to import like this: import net.jscience.math.kvm.MathFP;
Can you tell me how in the hell can i this class to import?
(I tried about 6 hours long, and i got some result, but not the really perfect.)
When i make this subdirectory structure (what is in the import line) into my project, then in eclipse work the auto completing, 'till the class name. :-/. But the class is there. Egal i add an external class folder, i got always the same result.
Please help me, because my brain at the moment wants to explode.
Thanks a lot.

Similar Messages

  • How to import a class not in the package from a package

    how to import a class not in the package from a package?

    http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html

  • How to import java Classes in report Builder 10g

    How to import java Classes in report Builder 10g .....
    Arshad

    Hello,
    To import the Java classes:
    Add your jar in the REPORTS_CLASSPATH
    Launch Reports Builder.
    Note:
    You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
    Choose Program > Import Java Classes to display the Import Java Classes dialog box.
    Regards

  • How to import jsf libraries into eclipse

    hi,
    i want to run jsf applications in eclipse......
    i installed tomcat, j2sdk, eclipse, and tomcat plugin.... and configured everything....now i want to excute jsf applications in eclipse...how to import jsf libraries into eclipse....
    plz help me

    ok thank u
    i have other doubt
    i am using tomcatplugin instead of myeclipse plugin
    is tomcat plugin supports jsf or not?

  • How to import a class from a package at the same level

    Hello friends,
    i have a class as Plaf.java
    as
    package org.vaibhav.swing.plaf;
    import java.awt.*;
    import javax.swing.*;
    public class Plaf {
    other code
    }as you see, this is in org.vaibhav.swing.plaf package.
    I have one more class as
    package org.vaibhav.swing.frames;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class StartFrame extends JFrame implements ActionListener {
    other code
    }and this class is in package org.vaibhav.swing.frames
    Please hlp me how to use the class Plaf in StartFrame.java. Rather what import statement should i use in StartFrame.java.
    please help.
    thank you
    Message was edited by:
    vaibhavpingle

    but it then gives me this error
    StartFrame.java:11: package org.vaibhav.swing.plaf
    does not exist
    import org.vaibhav.swing.plaf.*;
    Have you first compiled Plaf.java and saved it in this directory strucuture
    /org/vaibhav/swing/plaf/
    And also have you set your classpath to the parent directory of org folder.
    Message was edited by:
    qUesT_foR_knOwLeDge

  • How to import a class, which is not in a package?

    Hi all,
    I have the following problem:
    A class A is not in a package. In another class B, which is in a package (let's say package X) I want to use the class A. Without importing the class A, I get the error "Cannot resolve symbol".
    Using the import statement import A; gives the error ". expected".
    How can I import that class?
    Best wishes to all ...
    Heiko

    > I have the following problem:
    A class A is not in a package. In another class B,
    which is in a package (let's say package X) I want to
    use the class A. Without importing the class A, I get
    the error "Cannot resolve symbol".
    I think not putting a class in a package is a bad practice. Avoid that.

  • How to import a class in 10g

    I have a jar file and wanted to import the class into pl/sql
    I have saved the jar file in c:\ora10g\forms\java and have this path to my classpath in default.env file when i tried to import the class . I got an error
    Importing Class C:\ora10g\forms\java\XXX.jar...
    Exception occurred: java.lang.ClassNotFoundException: C:\ora10g\forms\java\XXX/jar
    Can anyone help me how to set the classpath correctly.

    The path to the jar file (including the jar file name and extension) must be added to the FORMS_BUILDER_CLASSPATH registry variable for the import step. For runtime you need to have it in the default.env.

  • How to import the classes?

    Hai to all,
    May I know how to import the packages in j2me that are not in the midpapi classes.
    If I had some new package and I want to import that to my application
    For example .
    The javax.mail package is with me but I don't know how can I import it to my application.How to set a classpath to it.
    (I set a classpath so that the j2me is not accepting the package but j2se is accepting is ther a special way to set a classpath to those package and where to keep those packages i.e in which folder ...)
    Awaiting for the answers ..
    Thanks to you

    for sms check i.e. http://www.simplewire.com/. i know that there were some more companies but can't recall their names now :(
    for encryption: i'd use midp 2.0 and rms, let user write their message, store it encrypted on rms and then send using some sms api. but that's just me ;)
    hth

  • How to import other class in Flex Builder2?

    I use Flex Builder2,I want to import the other class,such as
    ascb,like follows:
    package {
    import flash.display.Sprite;
    import ascb.units.Converter;
    import ascb.units.Unit;
    import flash.events.Event;
    public class ApplicationExample extends Sprite {
    private var _square:Sprite;
    private var _angle:uint;
    public function ApplicationExample() {
    _square=new Sprite();
    _square.graphics.lineStyle(0);
    _square.graphics.drawCircle(0,0,2);
    addChild(_square);
    _angle=0;
    addEventListener(Event.ENTER_FRAME,move);
    private function move(event:Event):void{
    var
    converter:Converter=Unit.DEGREE.getConverterTo(Unit.DADIAN);
    var angleRadians:Number=converter.convert(_angle);
    _square.x=Math.cos(angleRadians)*100+200;
    _square.y=Math.sin(angleRadians)*100+200;
    _angle++;
    ApplicationExample.as is locate in direcotry C:\workspace,and
    I put package ascb into directory C:\workspace too,then I run
    ApplicationExample.as ,it raise following error:
    Description:A file found in a source-path must have an
    externally visible definition. If a definition in the file is meant
    to be externally visible, please put the definition in a package.
    Resource:Converter.as
    In Folder:ApplicationExample/ascb/units
    Location:line -1
    By the way,when I write import ascb.,it should show units,but
    it only show util, I guess I may put package ascb into wrong
    director,or the ascb don't put the route of Flex Builder2. I don't
    know how to do it!
    Please give me detail steps to solve above error!
    Thanks in advance!

    when I put as
    import a;
    while compiling, it prompt : '.' expected
    how to resolve it?
    thanksIn J2SDK 1.4, you can only import a class that is in a named package. The compiler is expecting a package_name.class_name;
    You do not need to import classes that are in the same package and all classes that do not specify a package name are in the same unnamed package. However you must import classes that are in different packages.

  • How to import java Classes in report Builder

    Hi, I want to import classes from a jar file into Report Builder (10 g). I'm not able to find my JAR in -- Program --> Import Java Classes option.
    I have set the classpath pointing to my JAR.

    Hello,
    To import the Java classes:
    Add your jar in the REPORTS_CLASSPATH
    Launch Reports Builder.
    Note:
    You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
    Choose Program > Import Java Classes to display the Import Java Classes dialog box.
    Regards

  • How to import a class

    Hi all
    I am developing two PDK projects. I have created a bean in second project. How can I use that bean i my first project. I mean how can import that bean in my first project. Note: I can't create the same bean in my first project.
    Pleae help.

    The path to the jar file (including the jar file name and extension) must be added to the FORMS_BUILDER_CLASSPATH registry variable for the import step. For runtime you need to have it in the default.env.

  • How to import custom classes from model to view controller in adf?

    hi...
    i have some custom classes in model layer in adf.
    i want to use them in view controller but i cannot import them.
    how is this possible?
    my jdev version is 11.1.1.5

    You normally don't have to do anything special. The view controller project has a dependency to the model project. So simply typing the class name should show you hte option to generate the need import statement for the class.
    However, not all classes which reside in the model project should be imported into the view Controller as it might break the MVC pattern.
    Timo

  • Importing existing classes to Eclipse?

    Suppose i just created a new Eclipse project. Is it possible for me then to import an EXISTING class as the
    main class for this project? I have tried to do it and can't see a way. It seems to only want new classes added
    to its projects. I know i can just cut and paste, but that is a pain so i want to know if i can just bring them in.
    Any ideas? Thanks

    i tried that, and i get these options:
    select import source:
    existing project into workspace
    external features
    external plug ins and fragments
    file system
    team project set
    zip file
    none of those looks like what i need. Any advice?use import>fileSystem

  • Surprise! How to import my class?

    I used java1.2.2 to compile my files before. No problem. But I want to use StringBuffer class, indexOf method, which supported by 1.4. So I update my java then compile my files. It is said that '.' not found, import xxxx, what is mean?

    Thanks, just I am not familiar with 1.4 version. JDK1.4 didnt specify any new ways to import classes, they have always been the same.
    How
    can I do to avoid the error? It is the only way to
    package all my files? Do you have any way to import a
    single class? For example:
    import java.lang.String;
    import MyBean; //this is a class named MyBean.
    declare in MyBean.java
    //And it have been compiled
    ave been compiled successfully.
    SiriusIf the class MyBean lies in the same folder u dont need to import it as classes in the same package are visible to each other. Else u will have to import it using the package import format, there is no other way.
    Always,
    Leo.

  • How to import API classes in JSP?

    hi,
    What is the syntax for importing Java API classes in JSP (like in .java files)?
    I've tried,
    <% import java.util.*; %>
    <%! import java.util.*; %>
    <%@ import java.util.*; %>
    <%@ page import java.util.*; %>
    ...all don't compile!
    Please help. Thanks very much!
    Gerald.

    <%@ page import="java.util.*" %>
    Look at these resources:
    http://java.sun.com/products/jsp/pdf/card11.pdf
    http://java.sun.com/products/jsp/pdf/syntaxref.pdf

Maybe you are looking for

  • Computer Shuts down when trying to update to v4.2

    Hi Internet, I am trying to update my firmware from version 4.1 to 4.2 and as I click the update button, my computer just shuts down and does not update. It's like the update button is acting as the shutdown button from the start menu. Is anybody els

  • Can I turn my soon to be old Apple TV into a wireless hard drive like TC???

    Can I turn my soon to be old Apple TV into a wireless hard drive like the TC???

  • Data in FM  A to FM B

    Hi all, i have  the following requirement: 1) There are two function modules - A , B 2) Need to write a select query and fetch the data into internal table in FM A, 3) The fetched data in FM A should be available in FM B. <b>The problem is i should n

  • Itunes for windows limitations

    Does anyone know of a limitation on the itunes database size on a windows based pc ? I have about 37000 songs by 12000 artists (appr 180 Gig) and updating the library is getting extremely slow. As the database is XML based, am I rapidly approaching t

  • How to change the name of column in ActionScript?

    I possibly know how to change the name of the column in DataGrid using mxml but dont know how  to change the name of column in  DataGrid using  ActionScript. var newDataGrid:DataGrid=new DataGrid();      newDataGrid.dataProvider=arrayCollection(): It