Professional Web Applications Themes

batch-file alike - Mac Programming

Hi again, is there something similar to a batch-file for the mac? All I would need to do is change into a directory and then start a program. In windows-batch it would look like this echo off echo Program started ... cd jre cd bin java -jar program.jar cls oh, and if it matters, the java needs to be run from within the diretory, not any other java that might be installed (for that to work in linux, I would have to put ./ in front of java, else it would start the installed java). And this would have to ...

  1. #1

    Default batch-file alike

    Hi again,

    is there something similar to a batch-file for the mac?
    All I would need to do is change into a directory and then start a program.
    In windows-batch it would look like this

    echo off
    echo Program started ...
    cd jre
    cd bin
    java -jar program.jar
    cls

    oh, and if it matters, the java needs to be run from within the diretory,
    not any other java that might be installed (for that to work in linux, I
    would have to put ./ in front of java, else it would start the installed
    java).
    And this would have to be done in OS X and the older versions

    David


    David Guest

  2. #2

    Default Re: batch-file alike

    On Wed, 12 Nov 2003, David wrote:
     
    On Mac OS X, you can write a shell script.
    On Mac OS 9/X you can use applescript.

    Fred 

    Frederick Guest

  3. #3

    Default Re: batch-file alike

    > On Mac OS X, you can write a shell script. 

    ok, thanx

    so I guess applescript will work for every mac os?


    David Guest

  4. #4

    Default Re: batch-file alike

    On Wed, 12 Nov 2003, David wrote:
     
    >
    > ok, thanx
    >
    > so I guess applescript will work for every mac os?[/ref]

    Every version since System 7 i think.

    Fred

    Frederick Guest

  5. #5

    Default Re: batch-file alike

    Frederick Cheung <DUH.ucam.org> wrote:
     
    > >
    > > ok, thanx
    > >
    > > so I guess applescript will work for every mac os?[/ref]
    >
    > Every version since System 7 i think.
    >
    > Fred[/ref]
    Java support is not upto current state of the art on non mac osX
    systems, as I recall. Depending how modern your java is used in the jar
    file...
    Carl Guest

  6. #6

    Default Re: batch-file alike

    In article <bot5d0$jf6$02$t-online.com>, David <org>
    wrote:
     

    You're asking the wrong question. Your real question is "How do I
    build a launcher for a Java application on the Macintosh? I need to
    support Mac OS X and Mac OS 9.2. Here's how I'd do it on Windows..."
     

    Don't assume that every platform is exactly the same, even when
    building Java applications. Particularly when you're talking about the
    areas where Java interfaces with the rest of the operating system.

    In the dusty old past, there were several different Java virtual
    machines available for the Mac. In modern times -- the late 1990s and
    beyond -- there is only one, provided by Apple with the operating
    system.

    You *do not* and *can not* install an application-specific Java virtual
    machine on the Mac. You need to use the one provided by the operating
    system.

    OK, actually, on Mac OS X there are a couple of Java virtual machines.
    There's the Java 1.3.1 VM and the Java 1.4.1 VM. Both are provided by
    Apple as part of the operating system. (The user will have to be
    running Jaguar/10.2 and run Software Update to get 1.4.1, or be running
    Panther/10.3.) On Mac OS 9.2 there's only Java 1.1.8.

    There is a tool called MRJ Application Builder or something like that
    that which will let you create a Java launcher application on Mac OS
    9.2. It's part of the MRJ (Macintosh Runtime for Java) SDK available
    from Apple's web site. The equivalent tool on Mac OS X is part of the
    Mac OS X Developer Tools and is called Jar Bundler. This will even let
    you specify whether your application should launch under the 1.3.1 or
    1.4.1 virtual machine.

    On Mac OS X with Jaguar (I think) and later, you can also use Java Web
    Start and build double-clickable jar files -- that is, the user just
    needs to double-click your applciation's jar file to launch it, because
    all of the necessary information about the JVM version required, the
    main class etc. is specified in its manifest.

    Apple has a whole lot more doentation on this on their developer web
    site <http://developer.apple.com/>.

    -- Chris

    --
    Chris Hanson <com>
    bDistributed.com, Inc.
    Outsourcing Vendor Evaluation
    Custom Mac OS X Development
    Cocoa Developer Training
    Chris Guest

Similar Threads

  1. Replies: 1
    Last Post: June 12th, 12:07 AM
  2. TO run an Application from Batch file
    By viki in forum ASP.NET Security
    Replies: 4
    Last Post: October 27th, 04:56 PM
  3. scheduled batch file does not run
    By bill in forum Windows Server
    Replies: 3
    Last Post: June 30th, 10:08 AM
  4. Cant run batch file from .asp under iis6
    By Curt_C [MVP] in forum ASP
    Replies: 1
    Last Post: July 26th, 12:07 AM
  5. How to run a batch file.
    By Mike John in forum ASP.NET General
    Replies: 1
    Last Post: July 23rd, 01:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139