How do Classpaths work with JAR files?

Hey all,
I have in the manifest file a path to a folder, plugins. In it I have a dir and files myDir/*.* so when unzipped it has <install-dir>/plugins/myDir/*.*. In the MF file I indicate the plugins dir as part of the class-path. When I want to load a .class file from the myDir/ dir below plugins, and the classes in there do NOT have package names in them, how is that done? Every time I try to access a file via Class.forName() it says ClassNotFoundException. If I hard-code the string as "myDir/myplugin" or use package identifer "myDir.myplugin" it still doesn't work. I don't want to unzip a ton of files from each plugin in one dir. I want a more organized way of storing them. However, because plugins can be added after the file is unzipped, I can't specify all the locations of plugins/<dir> dir's in the MF file if more are added later. Is there a way to locate and load a class in ANY dir, even those that are NOT in the class-path? Please help me out if you know. Thanks.

You have two options:
1) Add a Class-Path entry for each plug-in directory, not just the plugins.
Class-Path: plugins/myDir plugins/yourDir2) Go ahead and put the plug-ins in separate packages - package handling makes doing plug-ins easier in the long run. Two ways:
package plugins.myDir;    // no Class-Path entry requiredor
package myDir;            // which works with your current Class-Path

Similar Messages

  • How to use javap with jar files ?

    how to use javap with jar files ?
    thanks

    As long as the jar is on the class path, your gold. So,
    javap -classpath myjar.jar mypackage.MyClass
    Chuck

  • How Can I Work With PHTML Files In Dreamweaver ??

    I want to work with PHTML files in Dreamweaver CS3 - How do I
    go about getting this to work?

    The solutions is either of the following:
    Adobe Lightroom - Find moved or missing files and folders
    Copy the photos back into the exact same folder and folder location that they were in before
    I don't know what you actually did "when I pasted it back" ... but the bigger issue is that you shouldn't be working with these files in your operating system, period. Once you import them into Lightroom, you don't manage these files in your operating system.

  • I accidentally cut instead of copied a folder of previously imported raw files. When I pasted the folder back I could see it in Windows Explore but not in the LR library. How can I work with these files again?

    HI,
    My daughter will often ask me to give her raw files I've taken at family events so that she can process them in her own copy of LR. (I work too slowly, apparently.) Recently I inadvertently cut instead of copied a folder. When I pasted it back I could see it in Windows Explorer but not in my LR library. I thought that re-importing the files might work, LR gave me a message that they were already imported. I expect there is a way to make the files available again in LR and would be grateful for some advice.
    thanks
    Ken

    The solutions is either of the following:
    Adobe Lightroom - Find moved or missing files and folders
    Copy the photos back into the exact same folder and folder location that they were in before
    I don't know what you actually did "when I pasted it back" ... but the bigger issue is that you shouldn't be working with these files in your operating system, period. Once you import them into Lightroom, you don't manage these files in your operating system.

  • Working with jar files

    Hi Friends
    I created a project and tried to Make a Executable jar file. actually. got it. it is also Running when i click on the Executable jar file.
    Now my problem is I am using some Images for my application those images are in a directory Called Image . when i make JAR File.
    i use This Command
      jar cfvm Setup.jar Manifest.txt *.class Imageit creates a JAR Files called setup.
    it runs the Application also when i run the Project. Now when i copy the Setup.jar to some other Location Other than the Current Location.
    It is not showing the Images which are allready in my Application
    I don't the problem. I read through the java tutorials But i am not able to find out the Solution for this Problem
    Please help me out to overcome this Problem
    Thank you for your service
    Cheers
    Jofin

    Hi thank you for your reply
    Realy i don't follow what you say, Where you are telling me to add this line Main.class.getResource("Image/file.gif"). Whether in The Manifest File or Where ever, i read the Images?
    Actually i have 5 JFrame Where all the Frames Uses Images. Should i need to use this Line in all the 5 classes . Could you please explain me clearly.
    i am very new to java. so that i am not able to pick up quickly. please bare with me
    Thank you for your service
    Cheers
    Jofin

  • How do class paths work with JAR files?

    Hey all,
    I have in the manifest file a path to a folder, plugins. In it I have a dir and files myDir/*.* so when unzipped it has <install-dir>/plugins/myDir/*.*. In the MF file I indicate the plugins dir as part of the class-path. When I want to load a .class file from the myDir/ dir below plugins, and the classes in there do NOT have package names in them, how is that done? Every time I try to access a file via Class.forName() it says ClassNotFoundException. If I hard-code the string as "myDir/myplugin" or use package identifer "myDir.myplugin" it still doesn't work. I don't want to unzip a ton of files from each plugin in one dir. I want a more organized way of storing them. However, because plugins can be added after the file is unzipped, I can't specify all the locations of plugins/<dir> dir's in the MF file if more are added later. Is there a way to locate and load a class in ANY dir, even those that are NOT in the class-path? Please help me out if you know. Thanks.

    I really can't help accept to say that it is the way it is to avoid naming conflicts i think. can you make the plugins packages ? Otherwise especially if various people write them there may be some crazy naming conflicts hidden in trying to load things from anyplace.

  • How do I run a Jar file?

    Hey,
    I created a program that I want my friend to use so he can send me some information about his server. however, I can't figure out how to make it work with a jar file. For instance, I have a .class file called server and also a txt file called Manifest.txt so I write this command in my terminal.
    jar cf serv server.class Manifest.txt
    this then creates the jar file. Within the "Manifest" file I have written,
    Main-Class: server
    Now when I try to run this program I type in
    java -jar serv
    then it out puts this.
    Failed to load Main-Class manifest attribute from
    serv
    When I run the program with my JDK it works perfectly fine and the little server runs without a problem. I am extremely new to working with jar files to make programs work so I feel like im over looking something stupid. Does anyone know what else I need todo to make this program run? Thanks ,
    Cobbweb

    Isn't the "manifest" supposed to live in the jar's
    "meta-inf" folder, and be named "manifest.mf" (not
    manifest.txt)?Yeah, but wouldn't you think the "jar" command would take care of those details? The help for its "m" options just says "include manifest information from specified manifest file".
    There are stupid things to watch out for, though, like having a proper line-ending (e.g. CR/LF) on the last line of the manifest file. And usually you make the name of your jar file have a ".jar" extension, although I doubt it would be a problem if you didn't do that.
    Looking inside the jar file would tell you a lot. Such as if the server.class file wasn't in it, or was in it but in the wrong directory, and so on.

  • Working with video files on compatible external drive with imovie09

    I have run out of room on my MacBook Pro hard drive, so I have moved all of my video files onto a compatible external hard drive. How do I work with these file in imovie09, do I need to import the files back onto the computer or can I work with them from the external hard drive, if so how. Also, is it possible to after completing editing to save just the project on the computer rather than the hard drive or will that cause a "source video" issue.
    Ultimately, I would like to have all of the source video saved on the external hard drive and the projects saved on the computer
    I had no problems working and saving the files when just using the computer, the external hard drive has complicated things for me. Thanks.

    John Pichola wrote:
    I have run out of room on my MacBook Pro hard drive, so I have moved all of my video files onto a compatible external hard drive. How do I work with these file in imovie09, do I need to import the files back onto the computer or can I work with them from the external hard drive, if so how. Also, is it possible to after completing editing to save just the project on the computer rather than the hard drive or will that cause a "source video" issue.
    How did you move all of your video files? The best way in iMovie '09 is to do it in the Event Library. Make sure you're viewing hard drives (click the disk icon at the upper-right corner of the list of events). Then drag the events you want from your internal hard disk to the external one. That way iMovie keeps track of where the source files are located.
    You can do the same with project files in the Project Library, too.
    If you've already moved the files in the Finder, to do it cleanly, I'd recommend moving them back to the iMovie Projects and iMovie Events folders in your Movies folder. Then launch iMovie and move them as explained above.
    Or, make sure the iMovie Projects and iMovie Events folders are at the top level of your external hard drive. When you launch iMovie, it looks in those places for footage and projects, and will make them available.

  • How to add the mail.jar file to my CLASSPATH ?

    Hi;
    I wish to Instal JavaMail 1.2
    To use the JavaMail 1.2 API, i unbundle the javamail-1_3_1-upd.zip file.....and now, i would like to add the mail.jar file to your CLASSPATH.
    My question is: how do you do this ?
    - ok i did that for CATALINA_HOME & JAVA_HOME but how to add the mail.jar file to my CLASSPATH ??
    1000 thanks.

    I think you're looking for "developer support", not packaged application support. different server, different batch of groups. . .
    Since I have very little contact with devopers, I don't truly know.

  • How can I work with my adobe Lightroom Version 5 which was added to my Samsung NX3000. If I want to load an .SRW File it is not possible, only the .JPG File. How and from where can I the Module and how is it to install ?

    How can I work with my adobe Lightroom Version 5 which was added to my Samsung NX3000. If I want to load an .SRW File it is not possible, only the .JPG File. How and from where can I the Module and how is it to install ?

    You need Lightroom 5.5 or later (the most current version is 5.7.1). This is a free update if you have already purchased an earlier version of Lightroom 5.
    Product updates

  • How can I make my source code with jar file?

    I use JDK1.6.0. I can open a class file from rt.jar and get its source code. Does this because open source JDK? I wander how I can make my jar file with source code.

    CeciNEstPasUnProgrammeur wrote:
    youhaodiyi wrote:
    But why I can read source code from rt.jar? I found there are only class files in it.I say it's highly likely that you can't and your IDE's settings rather automatically refer to the src.zip file in the JDK's directory.I see. That's true. I use eclipse as the source code reader. It may refer to the source code zip file automatically.
    Thanks all.

  • Crystal Report not works in JAR File

    I'm using Eclipse All in one, which includes Crystal Reports.. I Connected my Java program with Crystal Reports and its working properly. Now my problem is that the Report is not working in JAR files.. It throws some exception as
    "com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: com.businessobjects
    com.businessobjects.reports.sdk.JRCCommunicationAdapter---- Error code:-2147215357 Error code name:internal"
    Whats the Error.. I don't know. I think that i may missed some CLASSPATH Files. The included CLASSPATH Files are:
    ReportViewer.jar
    jrcerom.jar
    Concurrent.jar
    CrystalCharting.jar
    CrystalCommon.jar
    CrystalContentModels.jar
    CrystalExporters.jar
    CrystalExportingBase.jar
    CrystalFormulas.jar
    CrystalQueryEngine.jar
    CrystalReportEngine.jar
    CrystalReportingCommon.jar
    icu4j.jar
    keycodeDecoder.jar
    log4j.jar
    MetafileRenderer.jar
    rasapp.jar
    rascore.jar
    rpoifs.jar
    Serialization.jar
    URIUtil.jar
    xercesImpl.jar
    xml-apis.jar
    and the mysql-connector jar file
    Anybody help me please...

    Unable to load database connector
    'com.crystaldecisions.reports.queryengine..driverImpl.
    DriverLoader
    now you have any idea.. pleaseIs that a typo where you have two periods below?
    queryengine..driverImplOther than that I don't think anybody here can help you with that. If your classpath includes all necessary JAR files and you are able to access all your resources from within your application JAR file, then I imagine there is a problem with the third-party crystal decisions JAR file or how you are attempting to use it.
    My advice to you is to try and contact support with the vendor or provider of this API or possibly try posting on a support forum on their website to see if somebody can help you there.

  • Crystal Report not working in JAR File

    I am using Eclipse All in one, which includes the Crystal Report... I Finished every thing and the Crystal Report is working in Eclipse.. But its not working in JAR files.. Anybody suggest me WHICH FILES SHOULD BE SET AS CLASSPATHS FOR CREATING THIS JAR FILE...
    Thanks in advance

    Unable to load database connector
    'com.crystaldecisions.reports.queryengine..driverImpl.
    DriverLoader
    now you have any idea.. pleaseIs that a typo where you have two periods below?
    queryengine..driverImplOther than that I don't think anybody here can help you with that. If your classpath includes all necessary JAR files and you are able to access all your resources from within your application JAR file, then I imagine there is a problem with the third-party crystal decisions JAR file or how you are attempting to use it.
    My advice to you is to try and contact support with the vendor or provider of this API or possibly try posting on a support forum on their website to see if somebody can help you there.

  • How to call function in jar file?

    First, I can't write english well.(I'm korean.. ) sorry about that.
    I have known function in jar file.
    but I don't know how to call function in jar file.
    how can I this work?
    My project and another project are respectively developing D-project with me and other man.
    so i need it. or I can't do this work.
    I will paste other's source code in my source code.
    and then recomplie , build it.. but it is not my wish!
    thanks for reading my sentence.

    If you have a jar file with a class that you wish to use, then you must add the jar file to your class path ($CLASSPATH on unix, linux, etc. and %CLASSPATH% on Windows).
    Then you can use the class normally, just as you would if it were not in the jar.
    If you meant something else, you'll need to explain what you meant.

  • How can i rename a jar file using only java code

    i have tried everything i can think of to accomplish this but nothing works.

    ghostbust555 wrote:
    In case you geniuses haven't realized I said I tried everything I can think of not that I tried everything. So help or shut up I realize that I didn't try everything but if you can't figure it out either DO NOT POST.
    And the question is how can i rename a jar file using java code? As it says in the title. Read.I would tell you to use the File.renameTo method, but surely that would have been obvious, and you would have tried it already? But maybe you didn't. You were kind of lacking in details in what you tried.
    And yes, I am a genius. Just don't confuse "genius" with "mind-reader".

Maybe you are looking for

  • Another "iTunes won't open!" thread. Incl. detailed description and depair!

    Hello guys! First of all I want to apologize for any bad/incorrect language. Not only am I frustrated, but I'm Swedish aswell. THE PROBLEM My problem is the same one many others seem to have. iTunes has gone from working fine, to not working at all o

  • System generated index property not generated in database

    Hi, I created an offline table by copying it from an (first) online database to my project. The table contains a unique key constraint, which references a system generated index. Now I used this offline table to generate a table in another (second) o

  • How do I call pl/sql function from Toplink

    I can easily call a stored procedure from Toplink ==================================================== public Collection executeSelectingStoredProcedure(StoredProcedureCall storedProcedureCall) throws DAOException Collection returnValue = null; Sessi

  • Import Previews Low Resolution?

    As an Event Photographer I need to be able to quickly preview images from my Cards, Import only the "GOOD" images and transmit these for immediate distribution. Problem is the PREVIEW of the images PRIOR to import are very low resolution and don't al

  • Please Help! Problems with Mail on Mac

    Whenever I open my Mail on my Mac I am always faced with the below window: My password is correct as I can log in to Yahoo from the website. I do still get mail sent to my iPhone and can, on occasion, retreive on my Mac. No-one seems to be able to he