Announcement

Collapse
No announcement yet.

Problem to Compile concurrent.jar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jordan
    Guest replied
    sorry, to stupid

    Hi there,

    I have to fresh up the thread again, because I have the same problem.

    After the download i did the following:
    - cd installtemps
    - tar zxf concurrent.tar.gz
    - cd concurrent
    - mkdir bin
    - javac -d bin *.java
    here i got the same 2 warnings like mreczio (but ignored it )

    - jar cvf ../concurrent.jar
    but now i get the following message

    Code:
    ich:/installtemps/concurrent# jar cvf ../concurrent.jar
    Flag 'c' erfordert die Angabe von Eingabedateien!
    Syntax: jar {ctxu}[vfm0Mi] [JAR-Datei] [Manifest-Datei] [-C dir] Dateien ...
    Optionen:
        -c  neues Archiv erstellen
        -t  Inhaltsverzeichnis für Archiv auflisten
        -x  benannte (oder alle) Dateien aus dem Archiv extrahieren
        -u  vorhandenes Archiv aktualisieren
        -v  ausführliche Ausgabe für Standardausgabe generieren
        -f  Namen der Archivdatei angeben
        -m  Manifestinformationen aus angegebener Manifest-Datei einbeziehen
        -0  nur speichern; keine ZIP-Komprimierung verwenden
        -M  keine Manifest-Datei für die Einträge erstellen
        -i  Indexinformationen für die angegebenen JAR-Dateien generieren
        -C  ins angegebene Verzeichnis wechseln und folgende Datei einbeziehen
    Falls eine Datei ein Verzeichnis ist, wird sie rekursiv verarbeitet.
    Der Name der Manifest-Datei und der Name der Archivdatei müssen
    in der gleichen Reihenfolge wie die Flags 'm' und 'f' angegeben werden.
    
    Beispiel 1: Archivieren von zwei Klassendateien in einem Archiv mit dem Namen classes.jar:
           jar cvf classes.jar Foo.class Bar.class
    Beispiel 2: Verwenden der vorhandenen Manifest-Datei 'meinmanifest' und Archivieren aller
               Dateien im Verzeichnis foo/ in 'classes.jar':
           jar cvfm classes.jar meinmanifest -C foo/ .
    so do i have to give the command
    jar cvf ../concurrent.jar *.class
    ?? Or what does it mean?

    Thanks,
    Jordan

    Leave a comment:


  • slybob
    Guest replied
    never mind, fixed it

    I installed ant-options

    Leave a comment:


  • slybob
    Guest replied
    getting actual error during compile

    Hey, self explanatory really :-)

    Code:
       1.
          root@mail:/opt/src# javac -d bin EDU/oswege/cs/dl/util/concurrent/*java
       2.
          EDU/oswege/cs/dl/util/concurrent/Barrier.java:40: error while writing EDU.oswego.cs.dl.util.concurrent.Barrier: bin/EDU/oswego/cs/dl/util/concurrent/Barrier.class (No such file or directory)
       3.
          public interface Barrier {
       4.
                 ^
       5.
          EDU/oswege/cs/dl/util/concurrent/SemaphoreControlledChannel.java:70: warning: non-varargs call of varargs method with inexact argument type for last parameter;
       6.
          cast to java.lang.Object for a varargs call
       7.
          cast to java.lang.Object[] for a non-varargs call and to suppress this warning
       8.
              putGuard_ = (Semaphore)(ctor.newInstance(cap));
       9.
                                                       ^
      10.
          EDU/oswege/cs/dl/util/concurrent/SemaphoreControlledChannel.java:72: warning: non-varargs call of varargs method with inexact argument type for last parameter;
      11.
          cast to java.lang.Object for a varargs call
      12.
          cast to java.lang.Object[] for a non-varargs call and to suppress this warning
      13.
              takeGuard_ = (Semaphore)(ctor.newInstance(zero));
      14.
                                                        ^
      15.
          Note: Some input files use unchecked or unsafe operations.
      16.
          Note: Recompile with -Xlint:unchecked for details.
      17.
          1 error
      18.
          2 warnings

    Leave a comment:


  • Francisco Laguna
    Guest replied
    Those are only warnings, you can safely ignore. Just build the jar like neo proposed after compiling and you should do fine.

    Leave a comment:


  • mreczio
    Guest replied
    [QUOTE=neo;389]Can you please tell how you did that?


    Now i have create sie Directory /opt/src/EDU/oswege/cs/dl/util/concurrent/
    and /opt/bin.
    Then untar the conrurrent.tar.gz to /opt/src/EDU/oswege/cs/dl/util/concurrent/
    Code:
    cd /opt/src
    javac -d bin EDU/oswege/cs/dl/util/concurrent/*java
    and the output of this command is:
    Code:
    /SemaphoreControlledChannel.java:70: warning: non-varargs call of varargs method with inexact argument type for last parameter;
    cast to java.lang.Object for a varargs call
    cast to java.lang.Object[] for a non-varargs call and to suppress this warning
        putGuard_ = (Semaphore)(ctor.newInstance(cap));
                                                 ^
    EDU/oswege/cs/dl/util/concurrent/SemaphoreControlledChannel.java:72: warning: non-varargs call of varargs method with inexact argument type for last parameter;
    cast to java.lang.Object for a varargs call
    cast to java.lang.Object[] for a non-varargs call and to suppress this warning
        takeGuard_ = (Semaphore)(ctor.newInstance(zero));
                                                  ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 warnings

    Leave a comment:


  • neo
    Guest replied
    Can you please tell how you did that?

    If you have a look at the sources, you can see that the "concurrent" sources are in the "" package.
    Please create a directory tree with this command
    Code:
      
    mkdir -p src/EDU/oswege/cs/dl/util/concurrent
    mkdir bin
    and compile with this command
    Code:
    cd src
    javac -d bin EDU/oswege/cs/dl/util/concurrent/*java
    after that, create the jar file with this command.
    Code:
    jar cvf ../concurrent.jar .
    Hope that helps.
    Last edited by Guest; 03-13-2007, 09:18 AM. Reason: little typoe corrected

    Leave a comment:


  • mreczio
    Guest started a topic Problem to Compile concurrent.jar

    Problem to Compile concurrent.jar

    Hello
    I can't Compile the concurrent.jar
    I have download the concurrent source-code an when i compile i get only many errors and no a jar file.
    How can i download a compiled version of concurrent.jar or how i must compile the source-file?

    Sorry for my bad english

    Martin
    Last edited by Guest; 03-13-2007, 01:46 AM.
Working...
X