Jar file in source path, is it possible?

my question is quite simple:
1. can a java file (i.g. My.java) be zipped in a jar file then use the jar file in -sourcepath by javac.exe command?
2. can a java file be used in -classpath by javac.exe command?
3. can a class file (i.g. My.class) be used in -sourcepath by javac.exe command?
thx.

thanks.
i want to post my question again after read the webs.
1. if -sourcepath is not used, both class file and java file can be used in -classpath option.
2. if both -classpath and -sourcepath are used, class file must be in -classpath option and java file must be in -sourcepath. correct?
3. i did a test, jar My.java into any.jar then use -sourcepath c:\any.jar; (under windows) but compiler says My.java must be in file named My.java, so i think java file can't be jarred for using? correct?
thx

Similar Messages

  • How to add jar file in class path ?

    Hello,
    how can I add jar file in system class path.
    I am using Linux and installed java.
    Now I am creating one java package and working programs.
    I want to add commons-net-2.0.jar jar file into class path.
    how can I add in linux systems.
    Thank you.

    the same way you add anything else to the classpath.

  • Is there a way to exclude files from source paths using patterns

    Hi
    Does anyone know of any way to exclude files from source paths using patters rather than individually selecting the files? UI doesn't allow to specify any pattern. But if you look at the jpr file there are other places where patterns are allowed. Can the same pattern be copied and applied to excluded files?
    Pat

    Drag the files, or press Option when pasting them; this accesses the Move To function.
    (124070)

  • Jar file and relative path ?

    Hi
    1)When a jar file is run how can I access a file that is in the same directory that the jar is in ?
    (I need access to another file that is not in the jar.)
    2) If you read an ini file from the jar with getResource etc can you write back to that ini with new values ?
    Thanks for your help.
    Tim

    1) Use getResource to locate the jar url that contains the class. You will now have to extract the local filesystem path from the jar url.
    2) No

  • Jar files and class path

    I have a small swing application which connects to an external database and queries something and creates a small report on the local machine. Running from the command line calling the == java MyClass works good. I would like to deploy this to two other machines. I dont want the use to run from the command line solution. I want to run it from a batch file using the jar file. But I am getting a a classpath issue ( ClassNotFoundException for the jdbc drivers ) . I signed my jar file using jarsigner too. I am not interesed in using the Web Start because there are no other security attached to this app. Only couple of people intends to use it. Running from the command line calling the app file explicitly works. In the batch file I added the setclass path too. Still it gives an exception. I added the jdbc driver jar file to the appication jar file too. Still the problem exists.
    Any ideas ?

    instead of including the JDBC driver inside your application's jar, have the two jars sit in a directory separatly and include both of them on your classpath. Or, you can even specify a manifest.mf Class-Path parameter for your application's jar file so that it automatically includes the driver's jar.

  • Problem: Multiple jar files in Class-Path [ IOException: line too long]

    Hello Folks,
    I am trying to create a jar file using the following command:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    My MANIFEST.MF file is as following:
    Manifest-Version: 1.0
    Main-Class: com.gridftp.INSPgridFTP
    Class-Path: lib/activation.jar lib/ant.jar lib/antlr.jar lib/axis.jar lib/castor-0.9.3.jar lib/cog-abstraction-common-2.0.jar lib/cog-abstraction-examples-2.1.jar lib/cog-certmanagement-1.0.jar lib/cog-certrequest-1.0.jar lib/cog-grapheditor-0.46.jar lib/cog-gridfaces-1.0.jar lib/cog-gridshell-1.0.jar lib/cog-jglobus-1.2-050621.jar lib/cog-karajan-0.31.jar lib/cog-provider-clref-gt3_0_2.jar lib/cog-provider-clref-gt3_2_0.jar lib/cog-provider-clref-gt3_2_1.jar lib/cog-provider-clref-gt4_0_0.jar lib/cog-provider-condor-2.0.jar lib/cog-provider-gt2-2.0.jar lib/cog-provider-gt2ft-1.0.jar lib/cog-provider-gt3_0_2-2.0.jar lib/cog-provider-gt3_2_0-2.0.jar lib/cog-provider-gt3_2_1-2.0.jar lib/cog-provider-gt4_0_0-2.2.jar lib/cog-provider-local-2.0.jar lib/cog-provider-ssh-2.0.jar lib/cog-provider-webdav-1.0.jar lib/cog-resources-1.0.jar lib/cog-setup-0.91.jar lib/cog-util-0.91.jar lib/commons-discovery.jar lib/commons-httpclient.jar lib/commons-logging.jar lib/concurrent.jar lib/cryptix32.jar lib/cryptix-asn1.jar lib/cryptix.jar lib/j2ssh-common-0.2.2.jar lib/j2ssh-core-0.2.2.jar lib/jaas.jar lib/jakarta-regexp-1.2.jar lib/jakarta-slide-webdavlib-2.0.jar lib/jaxrpc.jar lib/jce-jdk13-125.jar lib/jgss.jar lib/jug-1.0.1.jar lib/junit.jar lib/log4j-1.2.8.jar lib/mail.jar lib/puretls.jar lib/saaj.jar lib/wsdl4j.jar lib/xercesImpl.jar lib/xml4j.jar lib/xml-apis-1.1.jar lib/xmlsec.jar lib/xpp3-1.1.3.4d_b4_min.jar lib/xstream-1.1.1-patched.jar .
    The grid-jar directory structure is:
    | - com -- all classes are under this dir.
    | - lib -- all the required jar files are in this dir.
    There are 59 jar files in the lib directory. When I try to create the jar file, I get the following exception:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    java.io.IOException: line too long
    at java.util.jar.Attributes.read(Attributes.java:356)
    at java.util.jar.Manifest.read(Manifest.java:167)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:904)
    Any idea, why do I get this exception? Is there any restriction as to how many jar files (or characters) can be there in the Class-Path value in the MANIFEST.MF file?
    Please help.
    Thanks,
    Ana

    use as the following way to resolve the problem:
    (1) use separate lines, to avoid too long a line for java package name lists
    (2) type a preceding space before each folloing lines, for example:
    Class-Path: ...jar ...jar ...jar
    ...jar ..jar
    ...jar ...jar
    ...jar ...jar
    Hello Folks,
    I am trying to create a jar file using the following
    command:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    My MANIFEST.MF file is as following:
    Manifest-Version: 1.0
    Main-Class: com.gridftp.INSPgridFTP
    Class-Path: lib/activation.jar lib/ant.jar
    lib/antlr.jar lib/axis.jar lib/castor-0.9.3.jar
    lib/cog-abstraction-common-2.0.jar
    lib/cog-abstraction-examples-2.1.jar
    lib/cog-certmanagement-1.0.jar
    lib/cog-certrequest-1.0.jar
    lib/cog-grapheditor-0.46.jar
    lib/cog-gridfaces-1.0.jar lib/cog-gridshell-1.0.jar
    lib/cog-jglobus-1.2-050621.jar
    lib/cog-karajan-0.31.jar
    lib/cog-provider-clref-gt3_0_2.jar
    lib/cog-provider-clref-gt3_2_0.jar
    lib/cog-provider-clref-gt3_2_1.jar
    lib/cog-provider-clref-gt4_0_0.jar
    lib/cog-provider-condor-2.0.jar
    lib/cog-provider-gt2-2.0.jar
    lib/cog-provider-gt2ft-1.0.jar
    lib/cog-provider-gt3_0_2-2.0.jar
    lib/cog-provider-gt3_2_0-2.0.jar
    lib/cog-provider-gt3_2_1-2.0.jar
    lib/cog-provider-gt4_0_0-2.2.jar
    lib/cog-provider-local-2.0.jar
    lib/cog-provider-ssh-2.0.jar
    lib/cog-provider-webdav-1.0.jar
    lib/cog-resources-1.0.jar lib/cog-setup-0.91.jar
    lib/cog-util-0.91.jar lib/commons-discovery.jar
    lib/commons-httpclient.jar lib/commons-logging.jar
    lib/concurrent.jar lib/cryptix32.jar
    lib/cryptix-asn1.jar lib/cryptix.jar
    lib/j2ssh-common-0.2.2.jar lib/j2ssh-core-0.2.2.jar
    lib/jaas.jar lib/jakarta-regexp-1.2.jar
    lib/jakarta-slide-webdavlib-2.0.jar lib/jaxrpc.jar
    lib/jce-jdk13-125.jar lib/jgss.jar lib/jug-1.0.1.jar
    lib/junit.jar lib/log4j-1.2.8.jar lib/mail.jar
    lib/puretls.jar lib/saaj.jar lib/wsdl4j.jar
    lib/xercesImpl.jar lib/xml4j.jar lib/xml-apis-1.1.jar
    lib/xmlsec.jar lib/xpp3-1.1.3.4d_b4_min.jar
    lib/xstream-1.1.1-patched.jar .
    The grid-jar directory structure is:
    | - com -- all classes are under this dir.
    | - lib -- all the required jar files are in
    e in this dir.
    There are 59 jar files in the lib directory. When I
    try to create the jar file, I get the following
    exception:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    java.io.IOException: line too long
    at
    at
    at
    at
    java.util.jar.Attributes.read(Attributes.java:356)
    at
    at
    at java.util.jar.Manifest.read(Manifest.java:167)
    at
    at
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:904)
    Any idea, why do I get this exception? Is there any
    restriction as to how many jar files (or characters)
    can be there in the Class-Path value in the
    MANIFEST.MF file?
    Please help.
    Thanks,
    Anajust

  • Jar file and source code? (new to java!)

    Hi all!
    Sorry if this is a dumb question but I'm really new to java (.net guy).
    Someone sent me a jar file and now I need access to source code. I now that I can rename to .zip and view its contents (.class)...
    But what about source code? Can I decompile? As i understand, .class files are compiled .java files...
    Should I ask for the source code to the guys that sent me the .jar file?
    thanks
    jay

    Humm... is java as fast as replies in this forum? Thank's for your replies warnerja and zadok
    I need the source code so that I can understand how the original developer solved a problem. I can ask for the source code.
    I posted this message because I was afraid that the question was stupid and source code was in front of me. I am really new to java!
    So. No source code in .jar or .class files. Right?
    Thanks
    Jay

  • Attaching source code of jar files in ecllipse edidor

    Hi all,
    i want to attach source code for jre system library 1.5 while i am using ecllipse 3.2. i also want to attach other source code for struts.jar .
    but i am unable to do it.
    my another problem is that i have struts.jar 1.2.9 and source code for that version is not available on the apache site.
    so please help me to attaching source file with jar files.
    thanks.

    source code for jre system library 1.5 under eclipse: Window -> Preferences ->
    Installed JREs -> here add JDK and not JRE
    (that's all !!)
    source code for struts.jardownload struts.xxx-src.zip from struts web site the
    add it to your struts project repository. Write some
    code that uses the struts API then select a struts
    class (ActionForm for example) and hit F3 keyboard
    key. Finally, click the button Attach
    Source... and select struts.xxx-src.zip you've
    just downloaded.
    do the same thing for all other jar which have a
    source code
    hope that helpsRather than change JVMs to do this, you could just follow java_2006's instructions for the JRE, looking for the source inside the folder where your JDK is installed. It's in a file called src.zip

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

  • Exporting JOGL project in Eclipse to an executable jar file

    I'm currently using Eclipse on Windows as my IDE and I've gotten [JOGL |https://jogl.dev.java.net/] to work on it, however if I try to export the project (I've just got a simple example that runs perfectly through eclipse) to an jar file (either the JAR or Runnable JAR option) the jar file doesn't do anything. If I go to the command line and type "java -jar <the jar file> -Djava.library.path=<where the library files are>" it gives this error:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
            at java.lang.ClassLoader.loadLibrary(Unknown Source)
            at java.lang.Runtime.loadLibrary0(Unknown Source)
            at java.lang.System.loadLibrary(Unknown Source)
            at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:189)
            at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:49)
            at com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeLibLoader.java:80)
            at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:103)
            at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:49)
            at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:111)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109)
            at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.<clinit>(WindowsGLDrawableFactory.java:60)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106)
            at Snippet209.main(Snippet209.java:75)Clearly I'm missing something. I want to make a jar file that I can send to an arbitrary computer and it will run the JOGL program with no extra steps (or at least as few as possible). Any help would be greatly appreciated with some Duke stars ;-)

    Ok, sounds like it would work, although I've never done much with loading libraries like you describe, so I could use some extra notes on it.
    I got this code from here and followed the instructions on there too to get JOGL to work with Eclipse:
    * Copyright (c) 2000, 2005 IBM Corporation and others. All rights reserved.
    * This program and the accompanying materials are made available under the
    * terms of the Eclipse Public License v1.0 which accompanies this distribution,
    * and is available at http://www.eclipse.org/legal/epl-v10.html Contributors:
    * IBM Corporation - initial API and implementation
    * SWT OpenGL snippet: use JOGL to draw to an SWT GLCanvas For a list of all SWT
    * example snippets see http://www.eclipse.org/swt/snippets/
    * @since 3.2
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import javax.media.opengl.GL;
    import javax.media.opengl.GLContext;
    import javax.media.opengl.GLDrawableFactory;
    import javax.media.opengl.glu.GLU;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.graphics.Rectangle;
    import org.eclipse.swt.layout.FillLayout;
    import org.eclipse.swt.opengl.GLCanvas;
    import org.eclipse.swt.opengl.GLData;
    import org.eclipse.swt.widgets.Composite;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.Shell;
    public class Snippet209
         static void drawTorus(GL gl, float r, float R, int nsides, int rings)
              float ringDelta = 2.0f * (float) Math.PI / rings;
              float sideDelta = 2.0f * (float) Math.PI / nsides;
              float theta = 0.0f, cosTheta = 1.0f, sinTheta = 0.0f;
              for (int i = rings - 1; i >= 0; i--)
                   float theta1 = theta + ringDelta;
                   float cosTheta1 = (float) Math.cos(theta1);
                   float sinTheta1 = (float) Math.sin(theta1);
                   gl.glBegin(GL.GL_QUAD_STRIP);
                   float phi = 0.0f;
                   for (int j = nsides; j >= 0; j--)
                        phi += sideDelta;
                        float cosPhi = (float) Math.cos(phi);
                        float sinPhi = (float) Math.sin(phi);
                        float dist = R + r * cosPhi;
                        gl.glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
                        gl.glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
                        gl.glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
                        gl.glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
                   gl.glEnd();
                   theta = theta1;
                   cosTheta = cosTheta1;
                   sinTheta = sinTheta1;
         public static void main(String[] args)
              final Display display = new Display();
              Shell shell = new Shell(display);
              shell.setLayout(new FillLayout());
              Composite comp = new Composite(shell, SWT.NONE);
              comp.setLayout(new FillLayout());
              GLData data = new GLData();
              data.doubleBuffer = true;
              final GLCanvas canvas = new GLCanvas(comp, SWT.NONE, data);
              canvas.setCurrent();
              final GLContext context = GLDrawableFactory
                        .getFactory().createExternalGLContext();
              canvas.addListener(SWT.Resize, new Listener()
                   public void handleEvent(Event event)
                        Rectangle bounds = canvas.getBounds();
                        float fAspect = (float) bounds.width / (float) bounds.height;
                        canvas.setCurrent();
                        context.makeCurrent();
                        GL gl = context.getGL();
                        gl.glViewport(0, 0, bounds.width, bounds.height);
                        gl.glMatrixMode(GL.GL_PROJECTION);
                        gl.glLoadIdentity();
                        GLU glu = new GLU();
                        glu.gluPerspective(45.0f, fAspect, 0.5f, 400.0f);
                        gl.glMatrixMode(GL.GL_MODELVIEW);
                        gl.glLoadIdentity();
                        context.release();
              context.makeCurrent();
              GL gl = context.getGL();
              gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
              gl.glColor3f(1.0f, 0.0f, 0.0f);
              gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
              gl.glClearDepth(1.0);
              gl.glLineWidth(2);
              gl.glEnable(GL.GL_DEPTH_TEST);
              context.release();
              shell.setText("SWT/JOGL Example");
              shell.setSize(640, 480);
              shell.open();
              display.asyncExec(new Runnable()
                   int     rot     = 0;
                   public void run()
                        if (!canvas.isDisposed())
                             canvas.setCurrent();
                             context.makeCurrent();
                             GL gl = context.getGL();
                             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
                             gl.glClearColor(.3f, .5f, .8f, 1.0f);
                             gl.glLoadIdentity();
                             gl.glTranslatef(0.0f, 0.0f, -10.0f);
                             float frot = rot;
                             gl.glRotatef(0.15f * rot, 2.0f * frot, 10.0f * frot, 1.0f);
                             gl.glRotatef(0.3f * rot, 3.0f * frot, 1.0f * frot, 1.0f);
                             rot++;
                             gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE);
                             gl.glColor3f(0.9f, 0.9f, 0.9f);
                             drawTorus(
                                       gl, 1, 1.9f + ((float) Math.sin((0.004f * frot))),
                                       15, 15);
                             canvas.swapBuffers();
                             context.release();
                             display.asyncExec(this);
              while (!shell.isDisposed())
                   if (!display.readAndDispatch())
                        display.sleep();
              display.dispose();
    }I have set up a project in eclipse with that file in the default package. I have created a libs/ folder in the project and I have the following files in it:
    gluegen-rt.dll
    gluegen-rt.jar
    jogl.dll
    jogl.jar
    jogl_awt.dll
    jogl_cg.dll
    swt.jarMy project is using the 3 jar files as libraries and I don't need to explicitly say anything about the dll files.

  • NoClassDefFoundError : when I am using MDM jar file

    Hi All,
    In my Webdynpro Java application, I need to acces the MDM Data. i have to use these jars,
    mdm-data.jar
    mdm-protocol.jar
    mdm-admin.jar
    mdm-common.jar
    mdm-core.jar
    MDM4J.jar
    and i getting this Error, while deploying the application to server.
    java.lang.NoClassDefFoundError: com/sap/mdm/net/ConnectionAccessor
    I guess, the reason may be that I dont have these above JARs in the server.
    Please give me a solution as soon as possible.
    Thanks,
    Boopathi.

    Dear Bhoopathi,
    You are getting classnotfound exception because, the external jar file you are using is available only at designtime (ie. Only in NWDS), and not available for runtime (ie. in J2ee server). To make it available in runtime, you have to deploy the jar file to J2ee server, so that the classes available in jar file will be available at runtime also.
    If the project is a simple webdynpro project, then, copy the jar file in to lib folder of the project and add the jar file in build path of the project. When this project is deployed, the jar file will also be available along with project. But, this jar file will be available only for this webdynpro project.
    If the project is a dc project, you have to deploy this jar file as a separate dc, and refer this dc in you dc project.
    Since jar file cannot be deployed directly, we have to bundle this jar to ear file,as a library.Once this library dc is deployed, you can use the same library dc in other dc projects also.
    For deploying external jar to J2ee engine, refer this link
    Bid adieu to bots - using CAPTCHAs
    I prefer this link, because it worked for me.
    If it is not working, refer this..
    A bit of (impractical) scripting for Web Dynpro
    Thanks,
    Fahad Hamsa

  • How to include images/icons for a jar file

    Hi,
    I need to create a jar file which will contain my application. My source code (.java) files are in "app" folder. I compiled that using javac -d . *.java and one package("appl") was created. I have all icons and images related to my application are in the folder named "icons" in the directory where source files are located i.e; app folder - "app/icons". I am accessing the images in the icons directory as "icons/book.gif".
    I created a jar file from source file directory with the option
    jar cvf app.jar app
    and i added this jar file to my classpath also.
    I have created a batch file to execute this application and set that batch file to "path" environment variable.
    It is running from any directory but no icons are appearing in that application if i try to run the application out side the "app" folder.
    Can any body give suggessions to solve this problem?

    Thanks for the added info, now let's get started.
    To use files in jars, you need to refer to them via a URL, so you'll need to modify your code a little bit first.
    URL imgURL = ClassLoader.getSystemResource("icons/BOOK.gif");
    setIconImage(Toolkit.getDefaultToolkit().getImage(imgURL));Next, you'll need a manifest. Using any text editor such as notepad, create a file called manifest.txt and put two lines in it. The first line will specify the class (w/o .class on the end) that contains your public static void main method, the second line is just an empty line (just press return).
    Main-Class: main
    (a blank line)
    Save this file with your class files (e.g. in Exam folder).
    Next build your jar. We want the jar to contain the package folder and your icon folder as well. So use this:
    jar cmf Exam/manifest.txt myJar.jar Exam/*.class icons
    And you should now have an executable jar. You can run it from dos with:
    java -jar myJar.jar
    or you can double-click it from windows.
    -Ron

  • A .dll inside a .jar file

    Hello,
    I want to place a .dll inside a .jar file ? It's possible, What is the library.path setting: the jar file or the path where the dll is put is in the jar file; and the argument of the System.loadLibrary?
    Thank for all

    Hello,
    I want to place a .dll inside a .jar file ? It's
    possible,Of course, you can put any type of file you want into a jar file.
    What is the library.path setting: the jar
    file or the path where the dll is put is in the jar
    file; and the argument of the System.loadLibrary?You cannot do a System.load() or System.loadLibrary() on something in a jar file.
    You have to first extract the dll to the filesystem. Then if you put it in the library path you can use System.loadLibrary(). But I think it is easier to use System.load() as you know the complete path to where you put the dll and can just supply that to System.load().

  • Traversing the Java Jar file

    Hi,
    This might sound like a weird question, but I need to traverse the Java Jar file and create respective Java objects into objects in some other language using reflection.
    Is it possible to find the path for the class files located in any jar file? Does Java supports traversing or reading and finding jar contents?
    Thanks

    I found a way to traverse the Jar, using java.util.zip, one can create a zip file for the given jar file and using ZipEntry it is possible to findout the properties associated with the jar/zip entries.

  • Can't access class files in jar file

    I'm running Eclipse and trying to access class files in a jar file from source. I have added the jar file through Properties/Java Build Path/Add External JARs... but the class files are not visible from my source code. Any ideas what is happening?
    Thanks!

    Depends what you mean by "visible." Are you getting a ClassNotFoundException? If so, your JAR isn't in your runtime CLASSPATH. You should be able to solve that (in Eclipse) by by modifying your project classpath.
    If "visible" means your code is usng a ZIP class to peek inside the JAR & it's not working, best bet is to re-study the ZIP class Javadocs & examine the error messages carefully.
    If this doesn't solve the problem, please provide more details & the specific error message/stack trace you're getting.

Maybe you are looking for

  • Installation Of Solman 7.1 aix Oracle failed with Java Error

    Dear All, We are doing SOLMAN Installation 7.1 SR1 AIX Oracle. Now the installation stopped at the 19th phase "IMport ABAP"as in the attached screenshot. OS : AIX 6100-07-02-1150 Database:  Oracle 11.2.0.3 Java Version currently maintained:  java ver

  • Installing BC 2.1 on a Virtual Machine (Xp Pro)

    I run VMWare Fusion on top of Boot Camp 2.0. The Fusion virtual machine is running Xp Pro. Can I install BC 2.1 from the virtual machine's Xp or should I quit Fusion and install BC 2.1 from the simple Boot Camp Xp "side" of my computer? Anyone have a

  • 7.1: Accessing Mobile Device Administration

    I am trying to set up a 'logical' mobile device. The class material (RNM71, Solution in Unit 5) says: "Open the Data Orchestration Administration and Monitoring Portal from the user menu. The portal opens in a separate browser window." Since the user

  • Unable to switch on to first first SAP Server

    Hi, We have 2 SAP Production Servers clustered and we use Enterprise portal. Recently, one of the Production server has rebooted unexpectedly. Since the production servers are clustered, users were not affected because switch over to 2nd production s

  • Trouble uploading Photoshop elements to a new computer

    I am having trouble uploading Photoshop Elements 12 to a new computer.  I have the disk for Photoshop Elements 2, so I uploaded it to the new computer.  I transferred the Photoshop Elements 12 executable file to my new computer When I tried to execut