- Joined
- Jul 5, 2010
- Messages
- 6
- Reaction score
- 0
- Points
- 1
How would I go about opening a .bat file meant for a Windows computer on a Mac? I know I would have to edit it/rewrite some of it, but what exactly do I edit?
BAT files are just text files. They contain script commands that Windows can interpret.
They can be edited on most platforms in any plain text editor (on OSX try TextEdit or Text Wrangler).
As to your question what to change . . . that's near impossible to answer. The file you've posted above appears to invoke a precompiled java app using a set of parameters.
I'd hazard a guess that it's a bespoke app of some kind.
You can change the commands by just typing/overtyping. But asking what to change is a nearly impossible question to answer from the info you've supplied I'm afraid.
You'd need to state what you are trying to do, what it does now and what it needs to do, but even then what you're asking is somewhat 'tricky'.
What's the end result you want to achieve? Are you trying to run this java app on Mac?
Try the following:If you still need the pause at the end, take a look at this.Code:#!/bin/sh cd <location> (replace with the location of the jar) java -Xmx1000m -cp .;Theme.jar Bot 0 0 lowmem members 32
/Users/danny/Desktop/SilGar v3.6/Run.bat: line 3: Theme.jar: command not found
Hold on, we're going to start over. First off, if Jar Launcher works for you, go with it. It may not work because it looks as if you're passing parameters to the jar file. Otherwise, let's start again.By the "location of the jar" do you mean something like /Users/Name/Desktop/SilGar\ v3.6/FILES? I tried doing that, then I opened the BAT file in Terminal, and then it said:
Code:/Users/danny/Desktop/SilGar v3.6/Run.bat: line 3: Theme.jar: command not found
And then below that, it says what I told the pause prompt to say.
#!/bin/sh
java -Xmx1000m -cp .;<location>/Theme.jar Bot 0 0 lowmem members 32
#!/bin/sh
java -Xmx1000m -cp .;/Users/Name/Desktop/SilGar\ v3.6/FILES/Theme.jar Bot 0 0 lowmem members 32
chmod +x <location of sh file>/<sh file>
chmod +x /Users/Name/jar_launcher.sh
/Users/Name/jar_launcher.sh
Hold on, we're going to start over. First off, if Jar Launcher works for you, go with it. It may not work because it looks as if you're passing parameters to the jar file. Otherwise, let's start again.
First, open up an editor and paste in the following:Replace <location> with the location of the jar. So, using your example, if the jar file was in /Users/Name/Desktop/SilGar\ v3.6/FILES, make sure the contents of this file read as such:Code:#!/bin/sh java -Xmx1000m -cp .;<location>/Theme.jar Bot 0 0 lowmem members 32
Save that with the extension .sh. Make sure to save it as plain text (if you're using TextEdit, go to Format > Make Plain Text before saving). Now, open up a Terminal and type the following:Code:#!/bin/sh java -Xmx1000m -cp .;/Users/Name/Desktop/SilGar\ v3.6/FILES/Theme.jar Bot 0 0 lowmem members 32
For example:Code:chmod +x <location of sh file>/<sh file>
Once that is done, your script is ready to execute. If you want to execute it, simply type the directory and name of the script at the Terminal prompt. For example:Code:chmod +x /Users/Name/jar_launcher.sh
Code:/Users/Name/jar_launcher.sh
java -Xmx1000m -cp . ; java -jar Theme.jar Bot 0 0 lowmem members 32
java -Xmx1000m -cp . && java -jar Theme.jar Bot 0 0 lowmem members 32