3 Replies Latest reply: Feb 24, 2010 4:49 PM by 800560 RSS

    JAR Problem

    843804
      HI! i have read most of the topics about jar problems but i am confused with that. I have an application with 3 classes (diamerisma.java , customerwindow.java , Main.java) and a txt file named Manifest.txt contained Main-Class: Main and an empty line. Firstly i had the main into the customerwindow.java but i was afraid that this was the problem.

      1. i created the jar file by typing in cmd jar cmf koinoxrisra.jar Manifest.txt *.java
      and a FileNotFoundException : koinoxrista.jar exception created

      2.Then i tried to create the koinoxrista.jar by setting an Application's Entry Point. i typed jar cfe koinoxrista.jar Main *.java
      and the jar created but when i tried double-clicking to it , an error occured said that it could not find the main class Main.

      i have read the java sun tutorial about the jar files.

      I write the code in the NetBeans 6.8 and i use windows XP.

      Could you tell me what to do???
        • 1. Re: JAR Problem
          800560
          >
          1. i created the jar file by typing in cmd
           jar cmf koinoxrisra.jar Manifest.txt *.java
          The 'm' and 'f' options correspond to the manifest text file and the jar file. You must specify the manifest and jar file in the same order as the m and f. Also, I think you intend to put Java classes into the jar file, so they can be executed. The command above would put Java source code into the jar file.
          2.Then i tried to create the koinoxrista.jar by setting an Application's Entry Point. i typed jar cfe koinoxrista.jar Main *.java
          and the jar created but when i tried double-clicking to it , an error occured said that it could not find the main class Main.
          See above.
          • 2. Re: JAR Problem
            843804
            You got it!! Thank you very much...
            Sth else . i have a problem with the language. In netbeans i wrote in greek language and the characters displayed correctly while running the programm. But when i have tο create .class files because netbeans dont create them i compiled it to JCreator and all the characters was unknown like CHINESE!!! this problem also occured when i run the jar file..
            Do you know the way to fix it??
            • 3. Re: JAR Problem
              800560
              kostas885 wrote:
              You got it!! Thank you very much...
              Sth else . i have a problem with the language. In netbeans i wrote in greek language and the characters displayed correctly while running the programm. But when i have tο create .class files because netbeans dont create them i compiled it to JCreator and all the characters was unknown like CHINESE!!! this problem also occured when i run the jar file..
              Do you know the way to fix it??
              Sorry, but I do not. I suggest posting a new question in either the New To Java or Java Programming forum (but please do not post in both).