Script help

Discussion in 'macOS' started by johnh57, Oct 27, 2011.

  1. johnh57 macrumors regular

    Joined:
    Jul 6, 2011
    Location:
    Montana
    #1
    Trying to download and install Mobile Atlas Creator. It comes with an executable script file to execute the program. When I run the start.sh file, it just opens up the text editor and blinks at me. This is what it is now:

    #!/bin/sh

    java -Xmx512M-jar Mobile_Atlas_Creator.jar

    # This file will start the Mobile Atlas Creator with custom memory settings for
    # the JVM. With the below settings the heap size (Available memory for the application)
    # will range from 64 megabyte up to 512 megabyte.

    it is supposed to run the .jar file - if I run that manually by clicking on it, it says I should run it from the start file and I need to have a "-Xmx512M" key on the start command. I edited the command line to include the key - but it ignores it. Obviously I am pretty clueless about java/linux.

    john
     
  2. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #2
    you need a space between M and -:
    Code:
    #!/bin/sh
    
    java -Xmx512M -jar Mobile_Atlas_Creator.jar
    
     
  3. johnh57 thread starter macrumors regular

    Joined:
    Jul 6, 2011
    Location:
    Montana
    #3
    It still just opens the file in a text editor with the curser flashing in front of the #!/bin/sh line.

    Do I need to do something with a chmod command? (and if so, exactly how?) sorry for being so dense, but I grew up using the 'other' system.

    john
     
  4. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #4
    Ahh, in the terminal type

    Code:
    chmod +x 
    
    with a trailing space. Then drag the file from the finder into the terminal. This should enter its absolute path in there for you. Press enter, and try double clicking again.
     
  5. johnh57 thread starter macrumors regular

    Joined:
    Jul 6, 2011
    Location:
    Montana
    #5
    this is what terminal looks like

    Last login: Thu Oct 27 09:39:03 on console
    Linda-Hightowers-MacBook-Pro:~ johnhightower$
    Linda-Hightowers-MacBook-Pro:~ johnhightower$ chmod +x /Applications/Mobile\ Atlas\ Creator\ 1/start.sh
    Linda-Hightowers-MacBook-Pro:~ johnhightower$

    double clicking on the start.sh file in the mobil atlas application folder still results in the start sh script file opening in the text editor.

    jh
     
  6. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #6
    Hmmm, I'm not sure how to get it to execute by clicking on it. You can, of course path to the location in terminal and type ./start.sh, but that is obviously not what you want to do. A little searching indicates that perhaps you can possibly rename it from start.sh to start.command.

    Try that...sorry I dont have much experience in making scripts clickable!



     
  7. johnh57 thread starter macrumors regular

    Joined:
    Jul 6, 2011
    Location:
    Montana
    #7
    That might be getting closer - still doesn't quite get there.

    ast login: Thu Oct 27 23:09:26 on ttys000
    Linda-Hightowers-MacBook-Pro:~ johnhightower$ /Applications/Mobile\ Atlas\ Creator\ 1/start.command ; exit;
    Unable to access jarfile Mobile_Atlas_Creator.jar
    logout

    [Process completed]


    it is at least trying to find the Mobile Atlas Creater.jar file.

    downloading the program ( zip file) and dragging the resulting zip file into the applications folder resulted in this file structure: (I renamed the start.sh file to start.command file)

    atlases (this is a folder)
    CHANGELOG.txt
    gpl.txt
    mapsources (this is a folder)
    mobac-profile-Google Maps New York.xml
    mobac-profile.xml
    Mobile Atlas Creator.exe
    Mobile_Atlas_Creator.jar
    README.HTM
    ReleaseNotes.txt
    settings.xml
    sqlitejdbc-v056.jar
    start.command
    tilestore (this is a folder)
     
  8. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #8
    Ok, I would have expected it to execute the commands from the directory in which is resides, but perhaps it isn't. Try this, edit your start.command to look like this:


    Code:
    #!/bin/sh
    
    java -Xmx512M -jar /Applications/Mobile\ Atlas\ Creator\ 1/Mobile_Atlas_Creator.jar
    
    # This file will start the Mobile Atlas Creator with custom memory settings for
    # the JVM. With the below settings the heap size (Available memory for the application)
    # will range from 64 megabyte up to 512 megabyte.
    
     
  9. johnh57 thread starter macrumors regular

    Joined:
    Jul 6, 2011
    Location:
    Montana
    #9
    That got it!

    thanks! - now if I can figure out how to use the program!

    John
     
  10. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #10
    :d

     

Share This Page