Look at classes in .jar

i want to decompose a .jar file so i can look at all the classes and figure out how it works.
how do i do this?
is it wrong/impossible to do this?
thanks

It has the format of a zip file, so you can use your favorite tool to unzip it. There's usually no source code in there, though. Are you sure you're not missing some obvious documentation?

Similar Messages

  • ClassNotFound in case of class from jar in lib folder

    Hello,
    I get an application that I have to deploy on Weblogic AS. It is big ear with couple of wars inside. Let's say it is bigApp.ear.
    It is deployed and state is Active. When go to browser and try to run an application I get an error. In logs I found ClassNotFoundException. The error is related to a class, let's say: com.some.package.Abc - I have this class in a jar file, let's say someFile.jar and it is in a folder WLS_FOLDER\samples\domains\wl_server\lib where:
    - WLS_FOLDER is my WLS installation folder
    - wl_server - name of my domain where I deploy an application.
    I wrote a small application (simple form), let's say simpleApp.war. The application uses the class com.some.package.Abc, but the class is not put into the war (WEB-INF/lib) of my small aplication (I use Maven and dependency to someFile.jar has scope provided, so simpleApp.war does not contain it). The result is that simpleApp works fine and there is no error in logs. It creates an instance of com.some.package.Abc and correctly display toString() of the instance of the class in a browser. So this means that application simpleApp is able to see and use classes that are inside jars in WLS_FOLDER\samples\domains\wl_server\lib folder.
    So my guess is that there is something in bigApp.ear but I don't know where to search. I read about class loaders hierarchy in Weblogic and Class Loader Filtering. But I have looked inside every weblogic.xml in bigApp.ear and wars that are inside and there is no filter on "com.some.package" or "com.some" or "com" only different packages.
    Is there any other mechanism in Weblogic that could block the visibility of classes from jars from lib folder of domain to the applications that are deployed in that domain??
    Regards

    Hi,
    Place that something.jar file under Domain_Home / lib folder and restart the server it will included with in the classpath and your app will able to pick the class without any issue.
    Regards,
    Kal

  • Java classes in Jar and Cab files

    Hello all,
    Our product supply java classes in Jar and Cab files that the browser downloads each time.
    The files are big and it takes a long time.
    Do you know of a way to make the cab/jar files be copied in to the user computer and that the browser would know to download files again only if there is a new version (otherwise take it from the local computer)
    Please help me
    Tamg

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • WAR Can't find class in JAR file in EAR/lib

    Hi,
    I have 1 EAR file with 1 WAR and 1 EJB-JAR file. Our main business-code is in a JAR-file which is placed in the EAR/lib/ folder along with the rest of the shared JAR-files.
    When i deploy the EAR the EJB gets deployed fine but when the WAR gets deployed, we get a ClassNotFoundException. We configured a class as a ServletContextListener (Which is part of the jar) in the web.xml so at startup it should perform some initiation. But since it can;t be found....
    I've tried changing the Mainfest.mf to include a CLASSPATH attribute with ./lib/x.jar but it stil the same problem. The only thing that solves it is to put it in the WEB-INF/lib folder.
    What am i doing wrong?
    Thanks,
    Maarten

    Here it is
    <?xml version="1.0"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
         <display-name>spg-online</display-name>
         <module>
              <web>
                   <web-uri>appname.war</web-uri>
                   <context-root>appname</context-root>
              </web>
         </module>
         <!--module>
              <ejb>appname-ejb.jar</ejb>
         </module-->     
    </application>
    My app follows the basic structure of an EAR-file:
    EAR
    META-INF
    application.xml
    lib
    appname.jar
    a.jar
    spring.jar
    appname.war
    appname-ejb.jar
    The meta-inf of the war-file looks like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.)
    Class-path: ./lib/appname.jar ./spring.jar
    I let ANT generate the Class-path:
    <jar jarfile="${dist.home}/${component.name}.war">
    <fileset dir="${build.home.webroot}" />
    <!-- dependency -->
    <manifest>
    <attribute name="Class-Path" value="${lib.project.manifest.classpath}"/>
    </manifest>
    </jar>

  • How to modify a specific class in jar file ?

    I've downloaded a jar file for applet, the jar file works fine... but when I extract a specific class file from the jar file and just recompie it from my IDE (Eclipse) without even making any change and then compress again jar class files including the new modified class file instead of the old one (without any modifications to other classes)... then I get
    (NoSuchMethodError ) exception whenever methods of other classes are invoked from within the modified class !!
    ...The manifist file of the jar file reads the following line
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    I thought it means that jar class files were built using JDK 1.4.0_01 ...I used JDK 1.5.0_01 in my IDE...
    I thought JRE incompatiblity was the reason of the problem so I downloaded JRE 1.4.0_01 and used it to build this class file... but i got the same exception..
    so what is the main reason of the problem ? ...should I make changes to IDX files accompanying applet jar files ??
    If no, then how can I overcome this problem and be able to change and rebuild a specific class from this jar file ?
    (I cannot rebuild all classes in jar because there are errors I cannot resolve !!)

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

  • How to pack .class or .jar with jvm into an exe file?

    In fact, .class or .jar files are middle layer files who need JVM to explain and run them. Sometimes it's unconvenient. Why not provide some tools to pack .class or .jar with jvm into exe file?

    because java should be able to run on any OS. That is why SUN doesn't provide such tool. There are other company's who does provide such tool. Like JBuilder enterprise

  • How to convert .class into .jar file

    Hi,
    How to convert .class into .jar file

    jsf_VWP5.5.1 wrote:
    Hi,
    How to convert .class into .jar fileFrom a command prompt, cd to the location of your .class file(s).
    If you want to create a simple jar, use: jar -cf Whatever.jar Whatever.class
    If you want to compile all .class files in a directory into a jar, use *.class instead.
    Now, I'm going to assume you want to create an executable jar... here's how to do that:
    1) Create a blank text file; for this example, lets call it main.txt.
    2) In the first line of main.txt, type: Main-class: Whatever ('Whatever' should be the name of the class in your program where the main() method is located)
    3) Press enter to go to the next line (someone please correct me if I'm wrong, but if you don't insert the line break/CR after the Main-class: statement, this will not work... in my experience, this is true)
    4) Make sure you save this file in the same directory as your .class file(s).
    5) Type: jar -cmf Whatever.jar main.txt Whatever.class
    ...and that's about it. For more information on the usage of the jar command and to understand the switches (such as -cmf), try jar --help.
    Hope that helps.

  • Disk permissions do not repair: Verify permissions for "Macintosh HD" Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/dt.jar", should be lrwxr-xr-x , they are lrw-r--r-- . Permissions differ on "System/Library/Jav

    Disk Utility does not repair Permissions (shows repaired but just come back up again). See problems:
    Verify permissions for “Macintosh HD”
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/dt.jar", should be lrwxr-xr-x , they are lrw-r--r-- .
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar", should be lrwxr-xr-x , they are lrw-r--r-- .
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jconsole.ja r", should be lrwxr-xr-x , they are lrw-r--r-- .
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/management- agent.jar", should be lrwxr-xr-x , they are lrw-r--r-- .
    User differs on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib", should be 0, user is 95.
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar", should be -rw-r--r-- , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar", should be -rw-r--r-- , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management -agent.jar", should be -rw-r--r-- , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/b lacklist", should be lrwxr-xr-x , they are lrw-r--r-- .
    User differs on "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries", should be 0, user is 95.
    Permissions differ on "System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/security/cacerts", should be lrwxr-xr-x , they are lrw-r--r-- .
    Permissions differ on "System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/deploy.jar", should be lrwxr-xr-x , they are lrw-r--r-- .
    Permissions differ on "System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPluginCocoa.b undle/Contents/Resources/Java/deploy.jar", should be lrwxr-xr-x , they are lrw-r--r-- .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/zh_TW.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/zh_TW.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/zh_CN.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/zh_CN.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/ko.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/ko.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/Dutch.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/Dutch.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/Italian.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/Spanish.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/Spanish.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/French.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/French.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/German.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/German.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/Japanese.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/Japanese.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/dt.jar", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jce.jar", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jconsole.jar ", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/management-a gent.jar", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/dt.jar", should be lrwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/jce.jar", should be lrwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/management- agent.jar", should be lrwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/security/bl acklist", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Resources/JavaPlugin Cocoa.bundle", should be drwxr-xr-x , they are lrwxr-xr-x .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Resources/JavaPlugin Cocoa.bundle/Contents/Resources/Java/deploy.jar", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Resources/JavaPlugin Cocoa.bundle/Contents/Resources/Java/libdeploy.jnilib", should be -rwxr-xr-x , they are lrwxr-xr-x .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/ Contents/Home/lib/security/cacerts", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/ Contents/Resources/Java/deploy.jar", should be -rw-r--r-- , they are lrw-r--r-- .
    Permissions differ on "System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/ Contents/Resources/Java/libdeploy.jnilib", should be -rwxr-xr-x , they are lrwxr-xr-x .
    Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired.
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/English.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/English.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .

    Ignore all these.
    http://support.apple.com/kb/TS1448?viewlocale=en_US

  • (Help) system classpath  -Vs-  the place where weblogic looks for classes

    The following is my app's hierarchy.
    myapp
    |
    |__myjsp.jsp
    |
    |__WEB-INF
    |
    |__classes
    |_ MyClass.class
    I am not able to use MyClass within myjsp.jsp
    i.e. a scriplet like that shown below gives an error stating that MyClass isnt found
    <% MyClass obj; %>
    I've tried setting the system classpath, but to no avail.
    Is there a difference between the system classpath and the place where weblogic looks for classes?
    (I am running my app by creating a myapp.war file and placing it in autodeploy folder)

    Try moving your class to a named package and use the appropriate import statement in your JSP. Loading it from WEB-INF/classes/packagename should be fine so you might want to remove the other classpath mods you made to eliminate that uncertainty.
    Here's a snippet from http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rweb_jsp_migration.html:
    "As of JSP 2.0, referring to any classes from the unnamed or default package is not allowed. This can result in a translation error on some containers, specifically those that run in a JDK 1.4 or greater environment which will also break compatibility with some older JSP applications. However, as of JDK 1.4, importing classes from the unnamed package is not valid. See Java 2 Platform, Standard Edition Version 1.4.2 Compatibility with Previous Releases for details. Therefore, for forwards compatibility, applications must not rely on the unnamed package. This restriction also applies for all other cases where classes are referenced, such as when specifying the class name for a tag in a Tag Library Descriptor (TLD) file."
    HTH,
    Mike
    Weblogic/J2EE Security Blog: http://monduke.com

  • Class to jar communication at run time

    Hi,
    I am developing a application using jdk 1.4 and have following query:
    I have an application that displays some information in various languages (according to the language selected), i.e english, french, german etc. Say I select english, the application will display "Hello World" in English language and so on for other languages..
    So my app is divided into three parts:
    1) Core application : displaying information
    2) XML file: Containing list of languages in XML format. This XML File can be updated for adding new languages. The format of XML file is somewhat as
    <LANGUAGE_NAME>___</LANGUAGE_NAME>
    <CLASS_LANG>____</CLASS_LANG>
    3) A seprate JAR file :Having set of classes corresponding to each language. The JAR file should be such that we can add classes for new languages added.
    The Workflow of app is as follows:
    When ever we run the application, the application reads the list of languages from the XML file and populats the list in a drop-down list box. Now, upon clicking a "GO" button, the application checks the language selected and calls the JAR will. It sends the class name corresponding to the language selected. And the class should return the information back to the application.
    Now, this process should be dynamic, i.e user can update XML with new language and update the JAR file with new class name.
    And upon just re-running the application, the application should be able to use features of new language.
    Consider that we have already shipped the application. All we have to do is to send updated JAR file to the user. and ask him to update the XML file for new language. i.e no changes to be done at application. And application should communicate with update JAR files at the end user.
    Now I have following queries:
    1) Is the above process possible? If yes, then
    2) How to communicate my application with the new class files in JAR file. i.e how to communicate my class with the UPDATED class in JAR file. Any prototype code to achieve this functionality would be of great help. Remember all this need to happen at run time.
    I hope my question is clear. Feel free to ask any queries.
    Thanks,
    rdh

    Java has a mechanism to cope with this - though it is not XML-based:
    java.util.ResourceBundle
    I would store the required resource (a property file or the XML or a jar) separately.

  • Can I increase heap memory without specify any class or jar file??

    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
    can I increase heap memory without specify any class or jar file??
    thx

    chiara wrote:
    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    can I increase heap memory without specify any class or jar file??The job of java.exe is to execute java bytecode.
    What is it supposed to do with your request to use 256m of memory for heap
    when you are not giving it a class or a jar to run?

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • Ojvmtc reports xy.jar is not a class or jar file

    Hi
    I am a little bit confuced because ojvmtc reports an error I can not imagine about:
    oracle@cikic-desktop:~/Downloads/dom4j-1.6.1$ ojvmtc /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar is not a class or jar file
    The set is closed
    But jce.jar is a jar file and I can inflate it:
    oracle@cikic-desktop:/tmp/fo$ jar -xf /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    oracle@cikic-desktop:/tmp/fo$ ls -l
    total 8
    drwxr-xr-x 3 oracle oinstall 4096 2010-05-03 19:40 javax
    drwxr-xr-x 2 oracle oinstall 4096 2010-05-03 19:40 META-INF
    And if I do a ojvm on a class file everything is working like expected:
    oracle@cikic-desktop:/tmp/fo$ ojvmtc javax/crypto/Mac.class
    The set is not closed
    96 classes are missing
    So It must be a configuration mistake somewhere ...
    Can you please help me out.
    Thanks
    Christian Maier

    Coole thanks, this works pretty well!
    Chris
    oracle@cikic-desktop:~$ cp /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar /tmp/
    oracle@cikic-desktop:~$ ojvmtc /tmp/jce.jar
    The set is not closed
    131 classes are missing

  • Can i use classes in jar files?

    im planning to create a program that uses the saxon.jar so that i don't have to type in the command line to be able to use it. is this possible?

    from reply #5, this is the statement with which i
    took exception.
    import saxon.jar.*;
    I knew what your post was about, my post was unrelated to yours, and directed at the OP. (that's why I didn't quote you).
    Your post is 100% correct, I only wanted to tell the OP (and other readers) that there is no difference between importing classes from jars and filesystems.
    /Kaj

  • Running classes in jar

    This is probably a fairly stupid question, but I wasn't able to find any documentation for this particular problem.
    I created your basic HelloWorld project with the following directory structure:
    HelloWorld
    |- classes/hello/world/HelloWorld.class
    |- src/java/hello/world/HelloWorld.java
    |- Manifest.txt
    Manifest.txt only has the following line:
    Main-Class: hello.world.HelloWorld
    Now, I try to jar this up and run it as a jar by performing the following in the HelloWorld directory:
    jar cfm hello.jar Manifest.txt classes/wgen/world/HelloWorld.class
    java -jar hello.jar
    And I get a NoClassDefFoundError: hello/world/HelloWorld exception. What do I have to do so I can run HelloWorld from the jar?
    Thanks in advance!

    Did you mean classes/wgen/world/HelloWorld.class or classes/hello/world/HelloWorld.class? You used both in your post.
    What is the package statement, if any, in the HelloWorld.java source code? How did you test the HelloWorld app before you jar'ed it? What is the output of "jar tf hello.jar"
    Assuming the directory path is classes/hello/world/HelloWorld.class, the source code starts with "package hello.world;" and your existing manifest then something like this cd classes
    jar cfm hello.jar Manifest.txt hello/world/HelloWorld.class
    java -cp hello.jar hello.world.HelloWorld
    java -jar hello.jarI always test a jar using the -cp option first to make sure I jar'ed the classes correctly, then test it with the -jar option. If it does not work with -cp then the classes are not jar'ed correctly. If it works with -cp but does not work with -jar, then the manifest is incorrect.

Maybe you are looking for