Hi.

Discussion in 'Computer Science & Culture' started by Executor, Aug 29, 2003.

Thread Status:
Not open for further replies.
  1. Executor Registered Senior Member

    Messages:
    104
    Im a Java newb, im majoring cs in college... and i just started so i was wondering if there is a place i can find a complete list of java commands... and how do i turn a .class file into a permanently executable file.... can anyone help so that i can just double click the prog i make and it executes.. i remember being able to do this with c++.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. okinrus Registered Senior Member

    Messages:
    2,669
    www.javasoft.com Java is a bit different than c++. Unless if you have a java compiler that compiles to the native platform your pretty much out of luck with the .exe However you can make a jar file that is excutable.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Voodoo Child Registered Senior Member

    Messages:
    1,296
    http://java.sun.com/j2se/1.4.2/docs/api/ Has the commands I think you think you want. Or do you mean the jar, javac, javaw java type thingees in the JDK?

    For the jar file you use the jar command

    <pre>
    Usage: jar {ctxu}[vfm0M] [jar-file] [manifest-file] [-C dir] files ...
    Options:
    -c create new archive
    -t list table of contents for archive
    -x extract named (or all) files from archive
    -u update existing archive
    -v generate verbose output on standard output
    -f specify archive file name
    -m include manifest information from specified manifest file
    -0 store only; use no ZIP compression
    -M do not create a manifest file for the entries
    -i generate index information for the specified jar files
    -C change to the specified directory and include the following file
    If any file is a directory then it is processed recursively.
    The manifest file name and the archive file name needs to be specified
    in the same order the 'm' and 'f' flags are specified.

    Example 1: to archive two class files into an archive called classes.jar:
    jar cvf classes.jar Foo.class Bar.class
    Example 2: use an existing manifest file 'mymanifest' and archive all the
    files in the foo/ directory into 'classes.jar':
    jar cvfm classes.jar mymanifest -C foo/ .
    </pre>

    and edit the manifest changing the main class entry to match your class

    C:\directory>jar cvf thing.jar Cruncher.class
    added manifest
    adding: Cruncher.class(in = 3673) (out= 2050)(deflated 44%)

    This isn't actually executable in the proper sense, but hey.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
Thread Status:
Not open for further replies.

Share This Page