How to import a class that have no package

I have .class archive that i need to use in a web aplication on Tomcat. I put the class in the directory: <webapp>/WEB-INF/classes/.
The class doesn�t have a package, so when i tried to import (..page Import=".....") it, tomcat gave me an error because is looking for a package instead of the class.
then i try to use it without the import and tomcat gave another error because it can�t find the class.
Any ideas??
by the way.. I don�t have the source code, I just have the .class archive..
thank you....

Also, I already found that the class had no package. Then you are out of luck.
As of java 1.4 you can no longer import classes that are not in a package. [url http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=c85f07c1ce8f344d787b7a5146d68:WuuT?bug_id=4361575 ] Full details here
The only solutions I can think of
1 - get the people who originally gave you the class to package it properly.
2 - Decompile it to java code, Change the java code to put it in a package and recompile it. Depending on the complexity of the class this may or may not be a trivial operation.
Good luck,
evnafets

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 a class that is in the database?

    Here's the picture: I have a server running on a machine and the client side is a stored procedure located in the database. Instead of writing multiple parameters on the stream, I send a Map of parameters. Therefore, both sides of the server needs to "know" the keys of my parameters in the Map. So I end up declaring constants in both the client and server class.
    Is there a way for the server to import the static content of the client class that's in the database? ( Or vice-versa )
    Thanks in advance!

    Is this a JDBC question?
    Meta data solutions mean that you will only find problems at runtime that would be obvious at compile time with a non-metadata solution. Code generation makes production of large numbers of these easy.
    But if you want metadata then you create a seperate class in a seperate package which holds the constants. The specifics depend on the implementation but you will typically have one class for each 'type' that is supported.
    That package is used by both the server and the client code.
    You can of course put other common functionality in the package (like a wrappers for the collections themselves, validation of names, etc.)

  • Import java class that uses DbConnection

    How to import java class that uses DbConnection? I don't want to write my own PluginDataSource.
    It is possible to get Connection in imported java classes?

    This is not possible. Even connection used by individual PDS are only limited to those individaul PDS only and are not shared across them.
    Thanks
    Rohit

  • How do I get CDs that have been imported into iTunes library to sync/transfer to phone?? very frustrating and any help would be appreciated. all the material i purchased from itunes transferred fine, but CDs won't. Please help!

    How do I get CDs that have been imported into my iTunes library to sync/transfer to my iPhone?? All the material that I purchased from iTunes has transferred just fine, but although the CDs will import to iTunes, they will not sync up with my phone. How do I do this?? I am very frustrated and would greatly appreciate any help.

    In what format did you import the cds?
    I have never had an issue with this.

  • 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 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 call a class that extends a frame from a panel ?

    How to call a class that extends a frame from a panel ?
    I am trying to create an application say "Videoshow"
    Videoshow has a panel which in turn consists of 2 components : 1]a textarea( to show the contents of a page) and 2] a mediaclip(to show the video).
    Now I have an application "MediaApplication"(to show the videoclip) which extends Frame (Code from Java 2 Unleashed, Chap 21). I want to show this MediaApplication in Component 2 of the above panel. But when I do this, I only see the MediaApplication frame instead of the whole SlideShow.
    I want to do something likethis.
    VideoShow :
    |---------------------------------|-------------------|
    | |
    | (Comp 1) | (Comp 2)
    | TEXTAREA | Video Clip
    | |(MediaApp entends Frame)
    |---------------------------------|-------------------|
    What is the best way to achieve this ? Also which component can I use to show the videoclip ?

    im not familiar with the code you mention from Java 2 Unleashed, but your best bet is to read up on Swing a bit - so you get an idea of how Swing containers and components work - then im sure you'll find a solution to your problems. Then if you encounter any difficulties whilst your attempting to do that, post your code in the Swing forum and im sure someone will help you.

  • Anybody know how you print off texts that have been sent to my iphone 4s,thankyou

    anybody know how you print off texts that have been sent to my iphone 4s,thankyou.

    Easiest way is to use something like this to import to your computer, then print them:
    http://www.wideanglesoftware.com/touchcopy/index.php
    Otherwise, you can take screen shots & print those.

  • How do I save photos that have been synced to my Ipad2, so that they do not get deleted when I sync with a different photo file on my computer.

    How do I save photos that have been synced to my Ipad2, so that they do not get deleted when I sync with a different photo foder on my computer (Pc win7).

    Place that first folder of photos that you synced to the iPad within the main folder of photos that you sync from and select them to sync again. You can place any number of subfolders within the main folder that you sync from and select those folders to sync. Just "tick"(select) the folders in the photos tab in iTunes.
    iOS and iPod: Syncing photos using iTunes

  • How do I combine files that have already been combined

    How do I combine files that have already been combined?

    Hi Oldshep1959
    I didn't get you ...Please Explain your workflow ...

  • HOW DO I FIND FILES THAT HAVE BEEN TRANSFERED FORM MY PC TO MY MAC

    How do i locate files that have been transfered from my PC to my new MacBook Pro

    Depends how they were transferred. If you used Migration Assistant, a new user was created. Look there in your documents folder. If you used Setup Assistant, look in your documents folder.

  • How can I restore photos that have a broken red symbol below them ? Thanks.

    Help!  How do I restore photos that have a broken red symbol below them? Thanks.

    Can you post a screenshot.

  • CV04N-Searching across multiple classes that have the same characteristics

    In CV04N- is there a way to search across mutliple classes that have the same characteristics?
    For example I created 3 new class types each assinged to a new class, each class having the same characteristics.
    Say if I have a characterisitics called Contract Name.  I need to be able to search for a contract name across all 3 classes.
    The search results in CV04N defaults to class type 017 so it only shows characterisitcs relate to that type, Is there a way to get the characteristics for the new created class types to show?
    I know in CV04N you can only search one class type and class at a time.
    Does anyone know of a way to fulfill these requirements, without creating a customized report?

    Hi Jenny,
    The answer for this question is that:
    1. The class 017 document management in cv 04n is SAP standard class .It's totally different than the new class created by you.
    2. The new class in CL02 you are creating is for a perticular document type. When you assign a characteristic (contract name) to this new class ,it appears in additional data field as contract name.
    3. Now you can make a search with only Contract name filed and the report will be displayed with all document types having this characteristic (Contract name) is assigned. Thus you can find the classes(document types)thru characteristic(contract name).
    I hope this will resolve the query. And you will get clarified between two classes( i.e. 017 and new classes in DMS).You can say them as subclassed under 017 class.
    Regards,
    Ravindra

  • How do I access files that have been recovered (after a Mavericks problem) with the .cca file extension

    How do I access files that have been recovered (after a Mavericks problem) with the .cca file extension

    First, to access documents you must use an app designed for that specific Document type. So Pages will not be able to open PDFs. The Documents app by Readdle can handle PDFs though. In the latter case, you'd open the app, click the menu icon at its top left, and click Open to go to your iCloud Drive. With Pages, if you had files outside the main Pages folder, click + then iCloud and navigate to the file's location.
    Matt

Maybe you are looking for