Making JAR File association under Win32

Hi,
Due to an agressive installation of a software on my system, I have lost my file association with jar files.
May someone help me setting it up again without having to reinstall the jdk by giving the correct parameters. I would appreciate.
Thank you

* open my computer
* select view | folder options
* select file types
* locate entry "Executable Jar File", and select edit
* select actions: open, then press edit
* browse for javaw.exe
* After you have browsed for javaw.exe, append to the end of the path the following: -jar "%1" so it looks something like this:
"C:\Program Files\JavaSoft\JRE\1.3.1\bin\javaw.exe" - jar "%1"
* click OK, and your done.
-Ron

Similar Messages

  • *.jar file association setting

    I use J2Sdk1.3.1_04 with Windows XP professional. I have a problem with the *.jar file association setting and I need someone's help on how to correct this. Anyone?

    In Windows Explorer menu: Tools | Folder Options | File Types, select jar file entry, click Advanced, and use what I posted to for the open action.

  • Making jar file in folder other than the working directory

    Hello!
    I am trying to make jar files by using a program. I execute jar commands at runtime. The problem is that when a command is given like this
    jar cvmf C:\HTTPS\Manifest.txt C:\HTTPS\khalid.jar C:\HTTPS\client.cer
    C:\HTTPS\Client.jar C:\HTTPS\client.keys C:\HTTPS\HelloRunnableWorld.class C:\HT
    TPS\HelloRunnableWorld.java C:\HTTPS\keytool interaction commands.txt C:\HTTPS\M
    akeJarRunnable.class C:\HTTPS\MakeJarRunnable.java C:\HTTPS\MakeJarRunnable.zip
    C:\HTTPS\Manifest.txt C:\HTTPS\myjar.jar C:\HTTPS\myjar_r.jar C:\HTTPS\Problem s
    cenario.txt C:\HTTPS\Run.bat C:\HTTPS\scompressed.jar C:\HTTPS\Security.jar C:\H
    TTPS\Server.jar C:\HTTPS\server.keys C:\HTTPS\serverexport.cer C:\HTTPS\Starter.
    class C:\HTTPS\Starter.java C:\HTTPS\Umer Farooq - What I did.ppt C:\HTTPS\Umer.jar
    The jar file is created but it has 0 bytes in it. No data is written into it, despite all the files being there.
    Thank You

    That is not the way to create jar files. Here is how you do it.
    Under say c:\ create directory "utils".
    Copy all of the *.java" files which will be part of this jar file "utils.jar". After moving files into c:\utils , make sure every single file has the first line of code as "package utils;" (without the quotes though)
    Type in "javac *.java" to compile all of the files at once.
    cd over to the parent directory and then type in
    jar cvf utils.jar c:\utils\*.class
    This will create utils.jar file under c:\

  • JAR file association

    Many of my customers have encountered problems with the .jar file extension being hijacked by some other program (usually zip/compression programs). There should be an easy way to restore this association (rather than re-installing Java!).
    If anyone has a simple solution please e-mail me ( [email protected] ).
    Thank you.

    There is. I'm assuming that you're using Windows - just open the Folder Options | File Types, select jar files | Advanced, and restore the open action.
    My XP Pro uses this action:
    "C:\Program Files\Java\jre1.5.0_01\bin\javaw.exe" -jar "%1" %*Replies are only made here, so that others can benefit.

  • Making jar file for java application with third party (Crystal Report)

    Hi all,
    I'm writing a java program that integrate with Crystal Report, I can run it in JBuilder fine, but when I try to make a jar file with JBuilder and run it, it either doesn't work or give me error.
    Case 1: If i only include the "dependencies", the program run but it woun't call the report when I open it. It give me the following error:
    com.businessobjects.reports.sdk.JRCCommunicationAdapter
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: com.businessobjects.reports.sdk.JRCCommunicationAdapter---- Error code:-2147215357 Error code name:internal
         com.crystaldecisions.sdk.occa.report.lib.ReportSDKException.throwReportSDKException(ILjava.lang.String;)V(Unknown Source)
         com.crystaldecisions.proxy.remoteagent.z.a(Ljava.lang.String;)Lcom.crystaldecisions.proxy.remoteagent.ICommunicationAdapter;(Unknown Source)
         com.crystaldecisions.sdk.occa.report.application.ReportAppSession.int()V(Unknown Source)
         com.crystaldecisions.sdk.occa.report.application.ReportAppSession.initialize()V(Unknown Source)
         com.crystaldecisions.sdk.occa.report.application.ClientDocument.for()V(Unknown Source)
         com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.for()V(Unknown Source)
         com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(Ljava.lang.Object;I)V(Unknown Source)
         com.crystaldecisions.reports.sdk.ReportClientDocument.open(Ljava.lang.Object;I)V(Unknown Source)
         GOV.NE.REVENUE.LB775.CRYSTALREPORT.JRCViewReport.launchApplication(JRCViewReport.java:43)
         GOV.NE.REVENUE.LB775.LB775$5.actionPerformed(LB775.java:1114)</message>
    case 2: if I include the "dependence and resources" when create jar file, then the program won't run. It gives me a message:
    Cannot find main class. Program will exit.
    But I do have the manifest.mf file that contain the main class.
    Thank you very much for any help.

    Hello, I have the same problem, did you solved it?
    Thanks

  • Making jar file for the project

    Hello Everybody,
    I have a project which has hibernate capability on and also have postgresql facility in the back-end. I have used Myeclipse to make the project which imports all the necessary libraries. Now I want to make an executable jar which will run the whole project without any compilation by only clicking the jar file. And I also want to maintain the main file as I have about 30 files.
    I need urgent help.
    Tinni

    As you are new to these forums, possibly you do not know:
    DO NOT duplicated your posts:
    http://forum.java.sun.com/thread.jspa?threadID=5262912&messageID=10094981#10094981

  • How to define new classpath of libraries while making jar files with ant

    I am useing eclipse and ant and trying to make a jar file. I have used some external jar files. I have managed to add external jar files to my jar. But Still I have a problem. In my project all libraries in lib folder. But when I put them into jar file. They are in the root folder.Classpath has changed and It couldn't find the class path.
    Is there any body knows how to define a new class path for external libraries with ANT. or How can I put my libraries into a lib folder in jar ?? I think both of them would solve my problem.
    thanks in advance.
    My code is like that, I think it requires a little modification
    <target name="jar">
            <mkdir dir="build/jar"/>         
            <jar destfile="build/jar/Deneme.jar" basedir="build/classes" >             
                <manifest>
                    <attribute name="Main-Class" value="${main-class}"/>                    
                </manifest>             
                 <fileset  dir="${lib.dir}" includes="**/*.jar"/>           
            </jar>
        </target>

    I can see why your other "question" was likely deleted. You need to drop the editorial comments and just ask a question. I believe what you want to know is how to configure something using php on your Apache server so that it can be read. If that's your question, here's a couple of places that discuss the topic:
    http://www.webmasterworld.com/linux/3345459.htm
    http://forums.macrumors.com/showthread.php?t=427742
    http://en.allexperts.com/q/PHP5-3508/configuring-installing-permissions.htm
    For a general introduction to 'nix permissions, take a look at this:
    http://www.osxfaq.com/Tutorials/LearningCenter/UnixTutorials/ManagingPermissions /index.ws
    And here's a whole book on the subject of Leopard permissions:
    http://my.safaribooksonline.com/9780321579331
    Try doing a Google search on "leopard permissions php apache" and see if you find what you are looking for.
    Francine
    Francine
    Schwieder

  • Making jar files available to javac?

    Sorry, this is probably just a dumb newbie question. I'm having a problem setting up a library jar file in a windows environment. I know that this is just an issue of setting up the PATH or CLASSPATH or something else correctly but I can't seem to get it right. Any hints, suggestions, nudges or outright handholding cheerfully welcomed.
    Thanks,
    Frank Vandenberg

    Setting the classpath isn't the same in all Windowz version.
    Win95/Win98/Win98 SE/Win ME:
    Here you have a c:\autoexec.bat
    so you can just add the following line:
    path="%jdkdir%\bin\"
    if there probely already is a "path-defenetion" in your autoexec.bat in that case just add it. i.e
    before: path="c:\windows\"
    after: path="c:\windows\;%jdkdir%\bin\"
    az you probely understand is not suppose to say %jdkdir% it suppose to say where you have it installed..
    I have jdk installed in "C:\jdk1.4\"
    That would for me make.
    path="C:\jdk1.4\bin\"
    And now if you have
    Windows NT 4.0/Windows NT 5.0(Win2000)/Windows NT 5.1(Windows XP)
    Here you have no autoexec.bat!
    So to permatetly add the path you need to use another way ->
    Deskop -> My Computer -> Controlepanel -> System -> Adcanced -> EvorimentVariables.
    Here you should already have some paths-defined, and you can easiely add the path you need..but be sure NOT do remove anything unless you know what/why your doing.
    Notice that i translated the deskription above..becuase my Windows is in Swedish...so the names may differ but its the same button.
    Good Lyck!

  • Errors in making jar file

    Hi all,
    The following is the simple bean I try to make
    import java.awt.*;
    import java.io.Serializable;
    public class SimpleBean extends Canvas
    implements Serializable {
    private Color color = Color.green;
    //getter method
    public Color getColor() {
         return color;
    //setter method
    public void setColor(Color newColor) {
         color = newColor;
         repaint();
    //override paint method
    public void paint (Graphics g) {
         g.setColor(color);
         g.fillRect(20,5,20,30);
    //Constructor: sets inherited properties
    public SimpleBean() {
         setSize(60,40);
         setBackground(Color.red);
    It is compile without problem. Now I try to make a jar file. First, I made a manifest file as follow:
    Name:SimpleBean.class
    Java-Bean:True
    and I had a carriage return at end of the file. Next, I issue
    jar cfm SimpleBean.jar manifest.tmp SimpleBean.class
    at the command line, but I got:
    java.io.IOException: invalid header field
    at java.util.jar.Attributes.read(Attributes.java:353)
    at java.util.jar.Manifest.read(Manifest.java:159)
    at java.util.jar.Manifest.<init>(Manifest.java:59)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:778)
    What did I do wrong? Please help,
    Wei

    check this http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html

  • Making jar files using API

    hello!
    I m trying to make a jar file using the API. When the jar tool is used for the same manifest file, it is correctly written and an executable jar is created. When I use the API, the jar file is made but it is nor executable. Here is that part of code:
    jar = new File(parent, jarName);
    System.out.println("Executing jar command...");
    //create jar file here
    Manifest mf = new Manifest(new FileInputStream(manifest));
    fos = new FileOutputStream(jar);
    jos = new JarOutputStream(new BufferedOutputStream(fos), mf);
    BufferedInputStream reader = null;
    byte[] data = new byte[BUFFER];
    int byteCount = 0;
    for(int i = 0; i < fileNames.length; i++)
    System.out.println("Adding " + fileNames);
    FileInputStream fis = new FileInputStream(fileNames);
    reader = new BufferedInputStream(fis, BUFFER);
    JarEntry entry = new JarEntry(new ZipEntry(fileNames));
    jos.putNextEntry(entry);
    while((byteCount = reader.read(data,0,BUFFER)) != -1)
    jos.write(data, 0, byteCount);
    }//end while
    reader.close();
    }//end for
    jos.close();//close jar output stream
    fos.close();
    I m sure someone will be kind and intelligent enough to solve the problem. Thank you!
    Umer

    A jar file is simply a Zip file. So the two API's are quite similar. First, you create a CRC - that is a way to make sure that the file isn't corrupted and that all the bytes are there (it's a polynominal algorithm that returns a number which is written in the Zip(Jar) file as well). Each entry is a file or directory. Before writing any data to the Zip(Jar) file, you have to write info on the actual file (like name, path, length etc). That's why you use putNextEntry(). Each file can have it's storing methods, although the most common is to use the "default" methods (built in the ZipOutputStream/JarOutputStream)
    But in this example you set the storing methods on the entry. You use the setMethod() method to switch between either storing or compression (don't know why, but in this example you don't compress the file - you should). I myself don't use the setSize() and setCompressedSize() methods at all (and it works fine). Don't know exactly what are the implications of using them. Neither do I use the setCrc() method (If I think a little, I've only used this API once - I don't use it that much), but it's quite straightforward. It's used to check that the data is ok, and since the CRC number is the result of an algorithm, it needs to know the bytes of UNCOMPRESSED data: that's why you use crc.update() on the bytes. After that you actually write all the info set before to the Zip (Jar) file using putNextEntry(). But remember that a ZipEntry doesn't have any data. You'll have to write it yourself: thus the need for the write method: Here are two small programs I used for Zipping and Unzipping. Changing them to work for Jar files is extremely simple:
    //Zip.java
    import java.io.*;
    import java.util.zip.*;
    public class Zip
         public static void main(String[] arg)
              try
                   if (arg.length < 3)
                        System.out.println("Usage: java Zip <0-9> <zip file> <file 1> [file 2] [file 3] ...");
                        System.exit(0);
                   System.out.println("Compressing files into file " + arg[1]);
                   ZipOutputStream out = null;
                   try
                        out = new ZipOutputStream(new FileOutputStream(arg[1]));
                   catch (FileNotFoundException ex)
                        System.out.println("Cannot create file " + arg[1]);
                        System.exit(1);
                   try
                        out.setLevel(Integer.parseInt(arg[0]));
                   catch (IllegalArgumentException ex)
                        System.out.println("Illegal compression level");
                        new File(arg[1]).delete();
                        System.exit(1);
                   for (int i=2; i<arg.length; i++)
                        System.out.println("\tCompressing file " + (i-1));
                        FileInputStream read = null;
                        try
                             read = new FileInputStream(arg);
                        catch (FileNotFoundException ex)
                             System.out.println("\tCannot find file " + arg[i]);
                             continue;
                        out.putNextEntry(new ZipEntry(arg[i]));
                        int av = 0;
                        while ((av = read.available()) != 0)
                             byte[] b = new byte[av < 64 ? av : 64];
                             read.read(b);
                             out.write(b);
                        out.closeEntry();
                        read.close();
                        System.out.println("\tDone compressing file " + i);
                   System.out.println("Done compressing");
                   out.finish();
                   out.close();
              catch (Exception e)
                   new File(arg[1]).delete();
                   e.printStackTrace(System.err);
    And the unzipping app:
    //UnZip.java
    import java.io.*;
    import java.util.*;
    import java.util.zip.*;
    public class UnZip
         public static void main(String[] arg)
              try
                   if (arg.length < 1)
                        System.out.println("Usage: java UnZip <zip file> [to dir]");
                        System.exit(0);
                   String dir = "";
                   if (arg.length > 1)
                        dir = arg[1] + System.getProperty("file.separator");
                        File f = new File(arg[1]);
                        if (!f.exists()) f.mkdirs();
                   System.out.println("Decompressing files from file " + arg[0]);
                   ZipFile read = null;
                   try
                        read = new ZipFile(arg[0]);
                   catch (ZipException ex)
                        System.err.println("Zip error when reading file " + arg[0]);
                        System.exit(1);
                   catch (IOException ex)
                        System.err.println("I/O Exception when reading file " + arg[0]);
                        System.exit(1);
                   Enumeration en = read.entries();
                   while (en.hasMoreElements())
                        ZipEntry entry = (ZipEntry) en.nextElement();
                        System.out.println("\tDecompressing file " + entry.getName());
                        FileOutputStream out;
                        try
                             out = new FileOutputStream(dir + entry.getName());
                        catch (FileNotFoundException ex)
                             System.err.println("\tCannot write down to file " + dir + entry.getName());
                             continue;
                        InputStream re = read.getInputStream(entry);
                        int nRead = 0;
                        for (byte[] buffer = new byte[1024]; (nRead = re.read(buffer)) != -1; out.write(buffer, 0, nRead));
                        out.close();
                        System.out.println("\tDone decompressing file " + entry.getName());
                   read.close();
                   System.out.println("Done decompressing files");
              catch (Exception e)
                   new File(arg[1]).delete();
                   e.printStackTrace(System.err);

  • Making JAR file visible to code in JDeveloper

    Hi. We're using JDeveloper 9.0.5 (planning soon to upgrade to latest version) and need to get a JAR file visible to code in a Java file. The JAR file is for the Java Advanced Imaging API, JAI_WINDOWS-I586.JAR
    What do we need to do to get this working? Thank you.

    Thanks, Frank. Finally got it working. The issue was this: The JAI API has 4 different JAR files for each platform. I'd downloaded one that contained an exe; I needed the one for the CLASSPATH installation.

  • Problem in making "jar" file

    Hi ,
    I have to compile , preverify and make jar file using a set of J2ME files.
    And i have completed the first 2 steps (compiling and preverifying).
    I used this code to make jar file:
    jar cvfm F:\Mobile_Magazine_IDE\xxx_test3\Magazine.jar F:\Mobile_Magazine_IDE\xxx_test3\src\MANIFEST.MF  -C  F:\Mobile_Magazine_IDE\xxx_test3\preveryclasses\  . -C F:\Mobile_Magazine_IDE\xxx_test3\src\images\  .
      boolean compile_n_print_output_to_console(String command){
        boolean isCompiled = false;
        try {
          txa_console_output.setText("");
          Runtime runtime = Runtime.getRuntime();
          Process proc = runtime.exec(command);
          InputStream stderr = proc.getErrorStream();
          InputStreamReader isr = new InputStreamReader(stderr);
          BufferedReader br = new BufferedReader(isr);
          String line = null;
          while ( (line = br.readLine()) != null)
            txa_console_output.append(line + new_line);
          int exitVal = proc.waitFor();
          //If this returns any value other than zero ... compilation failed
          if(exitVal!=0){
            call_error_message("Compilation failed ");
          //If this returns zero ... compilation is successful
          else if(exitVal==0){
            isCompiled = true;
            call_info_message("Build successful !");
        catch (Exception ex) {
          isCompiled = false;
          System.out.println(ex);
          com.zone.logger.LoggerClass.log_output(ex);
        return isCompiled;
      }The program is generating the jar file but it does not return a boolean value.
    I think it's because it has not completed the process.
    But no exception is shown.
    I used the same code to compile and preverify , and they work fine.
    And one more thing when i use the same source code and compile those using well known IDE it compiles and works without a problem.
    Can anyone tell me where i have done the mistake ?
    Thanks in advance !

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Associating executable Jar files w/ appropriate program

    Hi, I'm kinda new to java but this question is more OS related I think. I made a GUI program that reads / writes files and does some other stuff, I compiled it, then made it into an Executable JAR file. I put the file on my dektop w/ the required resource file (contains the read files) and then I double-click it and lo and behold Win-Ace(R) popps up. I right-clicked on the executable jar file, associated it with JAVAW, double-clicked again and it worked. So i guess my question is, is there a way that it will automatically associate itself with the right program so when I give this program to other people, they won't have to associate it the same way?
    Anyhelp would be greatly appriciated!

    No, becourse even if java could do that it would make sence becourse to run the jar it must be associated with javaw.
    But you could try to create a .reg file (registry file) that associate jar with javaw, when somebody runs the reg file it associate jar with javaw.
    But I think you should make different reg files for different windows versions (not sure about that).
    I don't have experience with how to write reg files but you just google.
    But I should try it out on your own windows, you could install windows on another partion and try it out on that one (first make a image with norton gost or something so if something goes wrong you can fastly get back to the old state).
    But you can also export your registry to a file so you can put the old registry back if somethings goes wrong.
    Use these tips on you own risk!!!

  • Deploying Runnable JAR Files

    I recently started working with Java 8.  I have been doing Java development on and off since the early 1990's.  Most recently I have been doing all my current work in Java 6.  I decided to "take the plunge" and to start getting involved with Java 8.  I have an imaging application for geologic research I started working on in Java 6 and Swing, and I am now continuing that development under Java 8.  It was a pleasant surprise that to find that all of my code built without any changes (I'm using Eclipse Luna and just deleted the Java 6 runtime and added the Java 8 runtime after downloading it).  The application launches fine from inside Eclipse.
    However I ran into a problem when exporting the application from Eclipse to a runnable JAR file and then trying to launch it.  After creating the runnable JAR I was not able to launch it by simply double clicking.  A command line box would open for a second, then close and the application window would never open.  To upgrade from Java 6 to Java 8 I only downloaded the Java 8 runtime environment, not the Java 8 JDK.  I am working in Windows 7 and tried updating the JAR file associations and experimented with various path entries in my environment variables.  No mater what I did I could not simply double click the runnable JAR to launch it.
    Then I deleted all my Java downloads and started over.  This time all I did was downloaded the Java 8 JDK and installed it.  I then pointed Eclipse to the Java 8 runtime environment that was installed with the Java 8 JDK.  My code built and executed perfectly in the Eclipse environment.  Then I exported the the Eclipse project as a runnable JAR again and tried to launch it.  This time it worked as expected.  Double clicking the runnable JAR launched the application!
    So my question is if I want to give this application to someone to run (i.e. deploy it) that is not a developer, do I have to have them install the Java 8 JDK?  I assumed that all someone would need to run the application as a runnable JAR is the Java 8 runtime environment, not the JDK.  However, when I had only the Java 8 runtime environment installed I could not launch the runnable JAR.  With the Java 8 JDK I was able to run the runnable JAR as expected, with no problem.
    Am I missing something?
    Thanks,
    Mike

    I found an answer to my own questions.
    I'm posting what I found to answer my questions so that anyone with a similar question looking here will have an answer.
    The following Oracle link appears to explain everything about deployment that a developer needs to know!
    http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/
    Mike

  • How to make .jar files executable by double clicking

    hi,
    I've been trying to make my .jar file created via ANT Tool executable by double clicking it but I'm not being successfull. I looked at the ANT Tool for making manifest.mf and I included most of the attributes listed there and later found that Main-Class attribute is required but its not mentioned in the documentation.
    So, I'll be very greatful to receive any suggestions
    regards,
    Jay

    ya I've been doing things the same way mentioned there but it isn't working. here is the code for it:
    //All the .class files are in the build directory and the class files are under the package org.home.proj.
    <!-- For making .jar files -->
    <target name="jar" depends="compile" description="Makes CyberStation.jar from the CyberStation code.">
        <mkdir dir="${bin}" />
        <jar jarfile="${bin}/CyberStation.jar" basedir="${build}">
          <exclude name="**/run.bat" />
            <manifest>
           <attribute name="Buily-By" value="${user.name}" />
           <attribute name="Main-Class" value="org.home.proj.CyberSoft" />
             <section name="org/home/proj/CyberSoft.class">
               <attribute name="Sealed" value="false" />
             </section>
         </manifest>
        </jar>
      </target>It show the error: Could not find the main class. The program will exit.
    regards,
    Jay

Maybe you are looking for

  • Virtual function in class

    Hi to all!! Somebody know if in ActionScript i can use the virtual function like C/C++ ? And in what way?

  • My Macbook only recognizes Apple Earbuds.... no generic headphones. Help?

    My 2010 Macbook has stopped working for almost all types of audio inputs. The exception is my Apple Earbuds. It will not recognize any generic headphones or my 1/8 inch to RCA cables as even being plugged in. Whenever I plug in my generic headphones

  • Regarding disabling the Pushdown SQL feature in Data Services

    Hi Experts, I have created a mapping using decode function for replacing the original values in legacy system to new SAP values specified. The mapping is showing no syntax errors, but while executing the job, it is saying that there are no sufficient

  • OTN Developer Day Regrestration Problem

    For the last two days, I've been trying to register for the developer day in Houston, TX. When I click the Register Now button, im taken to a page with the following content: We're sorry, There seems to be some problem in processing your request. We

  • Editing photos and deleting original

    Hi, I have tried to edit my photos (crop, change colors, etc.) but I always end up with my new edit having replaced my original photo, even if that is not my goal. Do you know of a way where I can both edit my photos and keep the originals? Moreover,