Batch file in Mac and Linux

Guys,
I have a prpgram which I need to invoke with -Xmx parameters, like java -Xmx512M -jar ***. I think it is a better way to provide a batch file instead letting the user type a long command line. So I prepare a MS-DOS .bat file with the distribution.
However, I don't know how to do such batch file in Linux/unix or Mac, which could let the user double-click and invoke the program with the parameters.
Could somebody give me some help?
Thanks!

Could somebody give me some information on Mac shell
script?Google for intro to bash scripts or something like that.
#!/bin/bash
java -cp whatever MyClassTypically the filename would end with .sh or .bash.

Similar Messages

  • Creating network between Mac and Linux

    Hello guys! I need to set up network between my iMac and Ubuntu linux. iMac is connected in internet by Airport and Fon Wifi Router witch is connected in router which is connected to adsl -modem. My pc is connected directly to router. Both computers have access to internet. Is there any easy solutions to share files with mac and linux? I don't need any webservers etc, I just want to share files.
    Other question related to this, why is my mac's ip address like 192.168... and linux ip addrress is 84.250...?
    Thanks allready!

    Though I'm not newbie with computers, I'm really confused becouse I haven't set up network like this never before.
    Not a problem, no worry... we all know something somebody else doesn't and vice versa.
    My linux says that my DHCP -IP is 193.210.18.18, is that related to this in any way?
    Yes, if the Mac had an IP of 193.210.18.x, (but not 18 for x), then connection would be simple, but I think we must have two devices passing out IPs. What is the Mac's IP again?
    http://www.helpdesk.umd.edu/topics/communication/ethernet/office/winxp/2882/
    Do you have any advice where I could start looking from the right IP of my linux?
    http://www.webmasterforums.com/networks-clusters/1804-find-ip-address-my-linux-b ox.html
    I'm not sure if its even configurable.
    http://tinyurl.com/2gug9s

  • Simple network: Windows 7 file server & several Macs and Linux machines- SAMBA bombing out?

    Hi guys, i know this is really more of a windows support question, but here goes:
    Windows 7 Ultimate 64bit acting as a file server, turned off all the usual MS authentication stuff so Macs and Linux systems connect with password without issues..
    except when i start copying certain files/file types/names to the system, it will break the network connection, then refuse any more connections, all macs and linux machines on the network are booted, from the PC however i can still access the Macs shares volumes.. (the macs still see the windows machine & pinging is still there, but if i try to connect i get 'check the name/ip address' error
    im no expert, but its as if the Samba service on the windows machine gets killed and im not sure what to do to get it to re-connect other then restarting the system, but as the system is also a terminal server users always have apps/documents open and its 'never a good time' to do it..
    if there was an alternate Samba to install, or a buffer patch, or even a 'goto this service, stop and restart' etc.
    Trying to get help from the 'windows' community comes down to 'well your on a mac what do expect etc etc' *sigh*
    any help is appreciated
    Richard

    Hi, just thought id update my finding regarding this, and it maybe directly affected by my only system, but in case anyone else has this issue?
    I thought it may be due to the file name thats causing the lockups, but I found while trying to backup my collection of install images and updates that sure enough a simple named file 'osx10.6.3.DMG' going to the server, 850MB in it stalls and fails, now im not able to connect.
    but form the PC, without changing the name or location etc, i copied the SAME from the Macs hard drive through to the windows system, all 5.7GB.
    so it is something to do with my windows 7 system, but maybe more related to the size of the file then the name or non-standard characters as first thought.
    as suggested by Grant above i will check on the server boards as well.
    thanks

  • Hi  can any body please tell me how to open the .exe files in mac and why it is not supported with unarchiever app , also i am not able to run and dvd's in my mac its not accepting any cd's or dvd'd why do i need to do some settings for it ?

    Hi  can any body please tell me how to open the .exe files in mac and why it is not supported with unarchiever app , also i am not able to run and dvd's in my mac its not accepting any cd's or dvd'd why? do i need to do some pre defined  settings to run the cd's and dvd's ?

    A .exe file is a Windows executable. OS X does not run Windows programs. If you need to use .exe files then you will need to install Windows on your Mac:
    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
    Install the Apple Boot Camp software.  Purchase Windows XP w/Service Pak2, Vista, or Windows 7.  Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows.  Boot Camp enables you to boot the computer into OS X or Windows.
    Parallels Desktop for Mac and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  Parallels is software virtualization that enables running Windows concurrently with OS X.
    VM Fusionand Windows XP, Vista Business, Vista Ultimate, or Windows 7.  VM Fusion is software virtualization that enables running Windows concurrently with OS X.
    CrossOver which enables running many Windows applications without having to install Windows.  The Windows applications can run concurrently with OS X.
    VirtualBox is a new Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris.  It is not as fully developed for the Mac as Parallels and VM Fusion.
    Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

  • Mac and Linux executables

    Hi,
    I want to turn my Jar file in to a Mac and Linux executable. For windows I found a lot of programs which can do that, like Lauch4J and JSmooth. I would like to know if there are programs like that for Linux and Mac.

    Hi Shnoogins
    Nope, that's one of the changes you see between version 2 and
    3. There is now only a single .EXE option. And Mac isn't it!
    Cheers... Rick

  • How do Mac and Linux find the JFX runtime?

    I've been searching the documentation without success for the answer to what ought to be a simple question -- how do I point Mac or Linux at the 2.2 runtime? It's no problem if I'm running in an IDE (NetBeans, e(fx)clipse), where I can tell the IDE where I unpacked the SDK. But what if I want to run a jar file, such as produced by the ant tasks?
    You'd think this would work (on Linux, where I unpacked the SDK into /opt):
    java -cp /opt/javafx-sdk2.2.0-beta/rt/lib/jfxrt.jar:. -jar MyProgram.jar But it doesn't -- I get a popup saying "This application requires a newer version of the Java runtime. Please download and install the latest Java runtime from java.com. Then restart the application" (I'm running with 1.7.0_05-b05 from Oracle).
    The only thing at all close I find in the Linux installation instructions is it says to unpack the samples as a subdirectory of the SDK, wherever I happened to put it, and then I should be able to run the examples with a simple "java -jar filename.jar". But even that's not quite true -- it only works if I first cd to the samples directory. But it's a start, so I tried...
    cd /opt/javafx-sdk2.2.0-beta/rt
    java -jar ~/dist/MyProgram.jarThat succeeds in finding the runtime, but my program doesn't work, because it doesn't find my dependent libraries. So I tweaked the command a little bit:
    cd /opt/javafx-sdk2.2.0-beta/rt
    java -cp ~/dist/MyProgram.jar -jar ~/dist/MyProgram.jarThat actually works. But it can't possibly be the right answer -- you shouldn't have to run a javafx program with the runtime directory as your working directory.
    And even that doesn't work on Mac. There, Java knows how to find the runtime that's installed with JDK 7 update 5 for Mac. But if I want to test a program with the 2.2 runtime, what do I do? Setting -classpath on the command line still uses the 2.1 runtime. And if I try the trick of connecting to javafx-sdk2.2.0-beta/rt first, it doesn't work at all -- it doesn't find my libraries, and it throws up a "java quit unexpectedly" window after getting a segfault.
    So what's a developer to do? Am I supposed to use the native packaging procedure instead?

    JavaFX 2.2 is first version where Linux/Mac are supported as runtime (and not just SDK).
    However, you need to install JavaFX Runtime that is part of JRE 7u6 (you can get beta from jdk7.java.net or wait for FCS version of it).
    Installing JRE is the only way to get JavaFX runtime installed on Mac and Linux (and eventually on Windows too).
    rt folder in the SDK is "private" copy of the runtime. It is not supposed to be used to run arbitrary JavaFX applications by default.
    You can still force to use it as
    java -Djavafx.runtime.path=/opt/javafx-sdk2.2.0-beta/rt/lib/jfxrt.jar -jar MyProgram.jar
    or
    java -cp ~/dist/MyProgram.jar:/opt/javafx-sdk2.2.0-beta/rt/lib/jfxrt.jar com.javafx.main.Main
    Note that if you use "-jar" then "-cp" is ignored by java launcher. This is not JavaFX specific behavior.
    JavaFX specific part is that properly packaged JavaFX main jar file will include copy of launcher class (com.javafx.main.Main)
    and this is what will be run when you double click on jar or use "java -jar". Launcher will try to locate JavaFX runtime to use,
    it knows how to find runtime in the SDK if it is sample located in the SDK itself and it also knows how to find installed version of runtime.
    If JavaFX is not found then it will show you message you observed.

  • Slow download on Mac and Linux using sockets

    We have a need to download as much as possible for a couple seconds using sockets, and we have noticed that Adobes flash player on Mac and Linux are slower then Windows while we get good results on all tree OS using Goggles flash player in Chrome.
    Our setup, client side, is a 1 Gbit/s internet connection throttle by a 100 Mbit/s switch. On the server side, we have an Apache web server (during testing) on a 1 Gbit/s internet connection.
    For testing purposes, we download as much as possible of a 2 Gb big file for approximately 10 seconds. After we connect to the server, via a socket, we send an http request to start downloading the file. Using bytesAvailable, we get the number of bytes downloaded every half second, calculate the average speed for that half second and store that value in an array. After 20 times, we stop downloading and close the socket connection. Finally we calculate the average download speed of the 20 measurements.
    All tests are preformed on version 11.6.602.180 except for Adobe Flash player on Ubuntu were the 11.2 r202 version. Adobe Flash player on Firefox 19.0.2 (other browsers were tested with similar results) and Google Flash player on Chrome 26.0.1410.43. Each OS/player was tested 5 times and presents the average.
    Windows 7 Enterprise (64-bit) 
    Mac OS X 10.6.8 (64 bit) 
    Ubuntu 12.10 (64 bit) 
    Adobe Flash player (NPSWF32_11_6_602_180.dll)
    92.73 Mbit/s 
    14.53 Mbit/s 
    44.25 Mbit/s 
    Google Flash player (pepflashplayer.dll)
    91,89 Mbit/s 
    89.46 Mbit/s 
    91.57 Mbit/s 
    doConnect();
    function doConnect():void {
        socket = new Socket(url,port);
        socket.addEventListener(Event.CONNECT, connectHandler);
    function connectHandler(event:Event):void {
        writeln("GET " + path + " HTTP/1.1");
        writeln("Host: " + url);
        writeln("Connection: close");
        writeln("");
        nStart = new Date().time;
        startTimer();
        socket.flush();
    function writeln(str:String):void {
        str +=  "\n";
        socket.writeUTFBytes(str);
    function startTimer(){
        startTime = new Date().time;
        var myTimer:Timer = new Timer(500,20);// 0.5 seconds 20 times
        myTimer.addEventListener(TimerEvent.TIMER, timeMeasurement);
        myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeMeasurementComplete);
        myTimer.start();
    function timeMeasurement():void {
        receivedData = socket.bytesAvailable;
        var varJunk:ByteArray = new ByteArray();
        while (socket.bytesAvailable > 4){
            socket.readBytes(varJunk);
        var split:Number = new Date().time - startTime;
        var speed:Number = receivedData * 8 / ((new Date().time - startTime) / 1000);
        startTime = new Date().time;
        downloadList.push(speed);
        receivedData = 0;
    function timeMeasurementComplete():void{
        var len:int = downloadList.length;
        var sum:Number = 0;
        for (var i:int = 0; i < len ; i++) {
            sum +=  downloadList[i];
        downloadResult = sum / len;
        socket.removeEventListener(Event.CONNECT, connectHandler);
        if(socket.connected){
            socket.close();
    In further investigation we built an easy Flash based latency meter. We download a small txt-file, measuring the time between just before we send http-request and until we receive a response from the web server.
    We have the setup as for the speed tests, but we do this 5 * 20 times with each OS/player.
    Windows 7 Enterprise (64-bit) 
    Mac OS X 10.6.8 (64 bit) 
    Ubuntu 12.10 (64 bit) 
    Adobe Flash player 
    4.30 ms 
    66.67 ms 
    10.49 ms 
    Google Flash player 
    4.25 ms 
    4.28 ms 
    4.19 ms 
    doConnect();
    private function doConnect():void{
        socket = new Socket(url,port);
        socket.addEventListener(Event.CONNECT, connectHandler);
        socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
    private function connectHandler(event:Event):void{
        writeln("GET " + path + " HTTP/1.1");
        writeln("Host: " + url);
        socket.flush();
        nStart = new Date().time;
    private function writeln(str:String):void{
        str +=  "\n";
        socket.writeUTFBytes(str);
    private function socketDataHandler(event:ProgressEvent):void{
        var latecy:Number = new Date().time - nStart; // latency in ms
    Using a packet analyzer (Wireshark) on the OS X/Adobe player, the time from http-request is sent to data is received is approximately 2 ms. An ack is sent less then 0.04 ms after the packet is received. Using the socketData event to send a new http-request, just after we measure the time for the last package, can see event created delays. We have a delay between 64 and 67 ms compare that to OS X/Google player with between 1 and 3 ms delay.
    Note: When playing around a timer, that fired a number of times during parts of a large number of latency measurements, we notice that measurements when the timer was running were better. Testing having a empty timer firing as fast as possible constantly during both download and latency measurements we got significantly better results on OS X/Adobe player, although not good. Average download 31,82 Mbit/s and average latency 16,59 ms.

    Bumping this topic again as it's still sort of bugging me, but the problem has been isolated to a few certain sites. On some i get the maximum speed and on others i get snailspeed. One of the slow ones unfortunately is basically anything that has to do with Apple....So all Quicktime movie trailers, iTunes stuff, movies etc are slow, except podcasts that are German. I'm downloading the 30 day trial of iWork and i'm getting whopping 19,2KB/s, when i should be getting about 1300KB/s. You can just imagine the frustration:/
    I'm just wondering am i alone on this or is anybody else excperienceing similar? And as usual, on windows i'm getting full speed all the time, anywhere, grrrr....!
    -CC

  • Share files between Mac and Windows in same iMac with boot camp

    Hello,
    I am new in using Mac and recently I buy a IMac 24" model.
    I used to use PC a long time with a lot of old document.
    I want to install Windows XP with boot camp.
    But I also want to share my documents, music, video files between Mac and Windows in same iMac.
    How can I do this?
    Thanks in advance,
    Eric

    Hi Eric and welcome to Discussions and the Apple world.
    Mac OSX can read and write from Windows partitions (like the BootCamp Windows partition you are about to create) when using FAT32 as file system for Windows.
    However with FAT32 you are limited to a partition size of 32GB.
    Mac OSX can also read from Windows partitions that uses the NTFS file system, but it can not write to them unless you use a third-party helper like either Paragons NTFS for Mac http://www.paragon-software.com/home/ntfs-mac/ or NTFS-3G http://www.ntfs-3g.org/
    Windows can not even see or use a Mac OSX partition without additional help by MacDrive http://www.mediafour.com/products/macdrive/
    Regards
    Stefan

  • Applet colors for Mac and Linux?!

    I've got an applet where I use Color(int, int, int) to set background colors of components. Running the applet on Windows in Netscape or Explorer gives the expected colors. But in Mac and Linux the backgrounds are only white (using Netscape or Explorer).
    Does anybody know why, and how I could set colors to be shown also for Mac and Linux?
    /Johan

    I doesn't seem to help using predefined colors, like 'red', 'blue', etc...

  • Batch file to start and stop

    Hi All,
    Can we create a batch file to start and stop the services. I need to start all the services like shared, essbase, eas, planning, webanlysis and financial reporting, and at also need to stop them using windows batch file.(Using windows 2003 server....service pack 1). Any help would be appreciated.
    Thanks

    Hi,
    The simplest script would be something like this. Save it as a .bat file, set all your services to manual and then set up a scheduled task to run this script when the computer starts.
    Gee
    ::          Startup Script for Hyperion Services          ::
    date/t >> startup.log
    time/t >> startup.log
    echo "Starting Hyperion Services" >> startup.log
    net start "Hyperion S9 OpenLDAP" >> startup.log
    net start "Hyperion S9 Shared Services" >> startup.log
    :: Insert pause of 5 seconds to ensure HSS has finished starting
    ping localhost -n 6 >nul
    net start "Hyperion S9 BI+ Analytic Services 9.3.1 - Essbase" >> startup.log
    net start "Hyperion S9 Administration Services ATS5" >> startup.log
    net start "HyperionRMIRegistry" >> startup.log
    net start "Hyperion S9 Planning" >> startup.log
    net start "Hyperion S9 Provider Services ATS5" >> startup.log
    net start "Hyperion S9 Apache 2.0" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Core Services 1" >> startup.log
    :: Insert pause of 10 seconds to ensure Core has finished starting
    ping localhost -n 11 >nul
    net start "Hyperion S9 BI+ 9.3 Workspace" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Java RMI Registry" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Print Server" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Report Server" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Scheduler Server" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Financial Reporting Web application" >> startup.log
    net start "Hyperion S9 BI+ 9.3 Web Analysis" >> startup.log
    date/t >> startup.log
    time/t >> startup.log
    echo "Finished Starting Hyperion Services" >> startup.log
    echo "###################################################################" >> startup.log

  • Font Issues on PC, MAC and LINUX

    Hey all,
    I have a software Applet that is designed to run on PC, MAC and LINUX. I am having troubles with the options dialogs and text areas that have strict size constraints. The font I use on PC to make the text fit into the space alloted to a JRadioButton (i.e.) in my menu doesn't seem to work on the MAC nor Linux. I am trying to figure out how to solve this problem. When it was just MAC and PC I simply made my fields a bit wider but with Linux involved now I want to develop a more robust solution. In theory I should find a font that is common to all 3 correct? Just wondering what should happen. Advice and input is much appreciated!
    Rob

    If the size of the component is critical, then you can over-ride the component's paint method (e.g. in a subclass) to scale the component's font to fit the component. I would only do this once, otherwise you'd be repeating the operation on every paint - use a "fontScaled" instance variable, for example.

  • Mac and Linux Users Please tell me if you can turn on webcams here

    Mac and Linux users who have the latest versions of Flash installed, please tell me if you can turn on webcams on this website that we are developing
    www.instadates.com/chat/
    Press enter and click on Turn on Webcam button.
    The webcams work perfectly fine in Windows 7, but I do not have a Mac and do not know how to update my flash on linux mint 11.

    I apologize...I did not put the correct link above. Now its fixed.

  • Dual boot mac and linux

    Hi,
    I am trying to install linux to my MacPro to run both mac and linux operating system. However, I have no clue that how to do that. Could you please give me a help in detail how to do it.
    Thank you so much,
    Xiao

    There are detailed instructions for various methods of installing Ubuntu on your machine here:
    https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation

  • I need to call a batch file from java and pass arguments to that Batch file

    Hi,
    I need to call a batch file from java and pass arguments to that Batch file.
    For example say: The batch file(test.bat) contains this command: mkdir
    I need to pass the name of the directory to the batch file as an argument from My Java program.
    Runtime.getRuntime().exec("cmd /c start test.bat");
    How to pass argument to the .bat file from Java now ?
    regards,
    Krish
    Edited by: Krish4Java on Oct 17, 2007 2:47 PM

    Hi Turing,
    I am able to pass the argument directly but unable to pass as a String.
    For example:
    Runtime.getRuntime().exec("cmd /c start test.bat sample ");
    When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
    String s1="sample";
    Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
    s1 gets passed here instead of value sample to the batch file.
    Pls let me know if you have a solution.
    Thanks,
    Krish

  • Sharing linked files between mac and pc

    Dear Community and AI Support,
    My team is trying to share AI files between Macs and PCs.  That works fine until we have Linked assets.  Once we have linked assets, AI either forgets to, or is unable to, let us relink more than one of the linked files.  We can't edit the links or even delete them.  The linked files are just ignored, leaving the file half empty. 
    We've tried hacking the paths directly in the .AI file, hoping to eventually write a perl script to help us switch back and forth. but no luck.  We assume there is a checksum or crc code or hash, etc..., as AI won't even try to open the file after that.
    But to clarify the issue. here is an example of the Mac and PC links we need to switch between using an excerpt from the AI file.  These are valid, working directories on both platforms.
    Mac flavor:
                   <rdf:li rdf:parseType="Resource">
                      <stMfs:linkForm>EmbedByReference</stMfs:linkForm>
                      <stMfs:reference rdf:parseType="Resource">
                         <stRef:filePath>/T/source/stories/00002/characters/puppy.ai</stRef:filePath>
                         <stRef:documentID>xmp.did:5bbaeed4-f8e3-f54b-b302-0b9d14f5a0eb</stRef:documentID>
                         <stRef:instanceID>uuid:1f66816c-99cb-4d62-ab88-aa6f9c92adad</stRef:instanceID>
                      </stMfs:reference>
                   </rdf:li>
    Win flavor:
                   <rdf:li rdf:parseType="Resource">
                      <stMfs:linkForm>EmbedByReference</stMfs:linkForm>
                      <stMfs:reference rdf:parseType="Resource">
                         <stRef:filePath>T:\source\stories\00002\characters\puppy.ai</stRef:filePath>
                         <stRef:documentID>xmp.did:5bbaeed4-f8e3-f54b-b302-0b9d14f5a0eb</stRef:documentID>
                         <stRef:instanceID>uuid:1f66816c-99cb-4d62-ab88-aa6f9c92adad</stRef:instanceID>
                      </stMfs:reference>
                   </rdf:li>
    Thanks! :]
    Chris

    ooohhhhh very interesting.  I did a find and replace on all the strings, but no dice.  I didn't think to look at those types of data.  But now that you have mentioned it, perhaps I'll do a diff on the same file saved on both platforms to see what has been changed.  Should have already thought of it, but your note has made me check my assumptions.

Maybe you are looking for

  • Indesign CS2 Crashes when I try to export a document as pdf

    I'm using Indesign CS2 on a G5 using OS X version 10.4.11. As i try to export my document indesign completely crashes after I click the 'export' button in the pdf options window. I've tried saving using different pdf options and different document ty

  • 1642 Error on Radius Console

    In testing our new BM38 Radius servers I've noticed some strange error reporting on the console. If the shared secret is incorrect we get a 1642 error on the server console. Likewise, if the password for the user is incorrect, we get the 1642 error.

  • Selection Criteria for Delta loads triggered using MDM_CLNT_EXTR

    Hi , Currently we are required to load data only from two specific account groups . Therefore in the selection criteria in mdm_clnt_extr we maintian these two account groups and extract data. However, when setting up the delta load there does not to

  • How do I publish iWeb site with Cyberduck??

    Hi there, I am trying and trying, but I can't figure it out. Can anybody help me and tell me how to publish an iWeb site with Cyberduck?? Thank you so much! Marc

  • FileServlet serving from FTP

    Hello! I'm trying to create a bean that opens a PDF file from another FTP server. I have it open from a local path, but can't get it to open from a FTP host. Your help is appreciated. Thanks in advance! -Tony package aiView; import java.io.BufferedIn