find jar file name from multiple set of jar files

Ads
 

find jar file name from multiple set of jar files

I would like to find jar file name from multiple set of jar files where the given class name√Ę‚?¨¬?com.rational.ft.util.debug√Ę‚?¨¬? is there

View Answers

February 17, 2011 at 3:12 PM

Java find jar file name from multiple set of jar files

import java.io.*;
import java.util.*;
class OnlyExt implements FilenameFilter{
  String ext;
  public OnlyExt(String ext){
  this.ext="." + ext;
  }
  public boolean accept(File dir,String name){
  return name.endsWith(ext);
  }
}
class  FindJar
{
    public static void main(String[] args) 
    {
        ArrayList list=new ArrayList();
        FilenameFilter ff = new OnlyExt("jar");
        File folder = new File("C:/");
        File[] files = folder.listFiles(ff);
        for(int i=0;i<files.length;i++){
            list.add(files[i].getName());
        }
        if(list.contains("examples.jar")){
          System.out.println("Jar file exist");
        }
        else{
          System.out.println("Jar file does not exist");
        }   
    }
}

Ads









Related Tutorials/Questions & Answers:
find jar file name from multiple set of jar files
find jar file name from multiple set of jar files   I would like to find jar file name from multiple set of jar files where the given class name√Ę‚?¨¬?com.rational.ft.util.debug√Ę‚?¨¬
Java JAR Files
to bundle multiple files into a single archive file. Typically a JAR file format... input_files Extract JAR file jar -xf  jar_file_name Extract a file from a JAR file jar -xf  jar_file_name
Advertisements
JAR FILE
and applications. The Java Archive (JAR) file format enables to bundle multiple files into a single archive file. For more information, visit the following...JAR FILE  WHAT IS JAR FILE,EXPLAIN IN DETAIL?   A JAR file
Reading a file from Jar JAVA
Reading a file from Jar JAVA  I have added one excel sheet into a jar file. can anybody tell me how i can read that file. actually when i am running code from eclipse i able to read it but when i am adding that jar file
Reading a file from Jar JAVA
Reading a file from Jar JAVA  I have added one excel sheet into a jar file. can anybody tell me how i can read that file. actually when i am running code from eclipse i able to read it but when i am adding that jar file
executing a batch file which depends on jar files from a system tray but console should not display.
executing a batch file which depends on jar files from a system tray... to run a batch file which is depending on some jar files and it displays a frame and some output generated by System.out.println()'s from system tray. I want
jar file - Java Beginners
specific files from a JAR filejar xf jar-file archived-file(s)* To run... options in jar file. What is Jar File? JAR files are packaged in the zip format  What is Jar File?JAR files are packaged in the zip format making
jar file
jar file  steps to create jar file with example
jar file
jar file  jar file where it s used
jar file
jar file  how to create a jar file in java
How to run java swing application from jar files .
How to run java swing application from jar files .  Hello Sir... setup file .As per my knowledge i have to run .jar file from dist folder of netbeans but when i am trying to run from there i am getting error "Could not find
I want to know the given class name exists in which jar file?
I want to know the given class name exists in which jar file?   I want to know the given class name exists in which jar file? C:\Program Files\IBM... the name of the jar file where 'com.rational.ft.util.debug' class exists
quqtion on jar files
quqtion on jar files  give me realtime examples on .jar class files   A Jar file combines several classes into a single archive file. Basically,library classes are stored in the jar file. For more information,please go
Java Execute Jar file
step is to make the JAR file executable. All class files of the application... this file into JAR file in a subfolder named Meta-inf. .jar files are executed...). The executable JAR files are different from other files as they have a hexadecimal field
jar file
jar file  how to run a java file by making it a desktop icon i need complete procedur ..through cmd
How to use JAR file in Java
Extract specific files from a JAR file - jar xf jar-file archived-file(s... means that the JAR file from which files are to be extracted is specified... in JAR files, then you just need to download one single file and Run it. When you
How to Unjar a Jar file in Java
A JAR file is a collection of Java class files that contains images, methods... multiple operating systems. Users can unjar a JAR files using the jar command.... x and f indicates the you're extraction files from the archive. Example: jar xf
Structs jar files
Structs jar files  please Post required jar files for structs. Thanks, L.Mahesh Kumar
File path for jar file
File path for jar file  Hi Experts, I have created one eclipse... jar file of that application, unfortunately it is giving the error that resource not found for the template file. Also I had tried to get that path from user
Running Jar file in Windows
Running Jar file in Windows  Running Jar file in Windows
jar file not reading input from serial port
jar file not reading input from serial port  i used a coding for getting data from serial port. JOptionbox with "port not found" message is shown when i execute thru jar file. but when i execute thru netbeans, data is received
jar file not reading input from serial port
jar file not reading input from serial port  i used a coding for getting data from serial port. JOptionbox with "port not found" message is shown when i execute thru jar file. but when i execute thru netbeans, data is received
Java Jar File
the contents of a JAR file from any file that can be opened... Java Jar File       In Java, JAR (Java ARchive) is a platform-independent file format that allows you
how to delete a jar file from mobile by using j2me program.
how to delete a jar file from mobile by using j2me program.  When i'll update a new version jar in mobile. Then i want to delete that old jar which is previously present in mobile. How to do
Apache HSSF Jar file location
Apache HSSF Jar file location  where can i get jar files for apache hssf
Extract Jar File
Extract Jar File  How to extract jar file?   Hi Please open the command Prompt and to the jar file and write the command jar -xvf JaraFileName.jar
How to create a jar file
???   The given code creates a jar file using java. import java.io.*; import...(); System.out.println("Jar File is created successfully."); } catch (Exception ex...(); File folder = new File("C://Answers//Examples"); File[] files
org.apache.commons.collections15.Transformer jar file
org.apache.commons.collections15.Transformer jar file  Dear, Please can you provide me the link for the following jar file: import org.apache.commons.collections15.Transformer; tahnks too much
.jar file keeps giving me " could not find the main class". Program will exit.
.jar file keeps giving me " could not find the main class". Program will exit... clean and build it which produces a .jar file in my dist folder. When I double... will exit." However, if I choose to run it from the command prompt "java -jar
jar file with html
jar file with html  I have a jar file. On double click it shows an applet page. Please tell me how to connect that applet into html or jsp page
Creating an executable jar file
Creating an executable jar file  When I try to create jar.exe through CMD, the manifest file created doesn't contain Main-Class attribute, even though it is included in text file used during creation of jar file

Ads