Here is some basic Unix info. Not many "El Capitan"-specific details are provided, but they should not be needed to get things to work. (I understand that an upgrade to "El Capitan" broke things. Perhaps it changed what is in your path, or altered some permissions. Following are details on how to make things work.
In DOS, a batch file is a text file that ends with ".BAT" (case-insensitive, so ".bat" would also work). Microsoft Windows follows the DOS tradition. Each line in the batch file is a command to be run from the command interpreter.
In Unix, including Mac OS X, a proper "shell script" file should have a proper header, and have proper permissions. Then, after the header, each line in the batch file is a command to be run from the command interpreter.
Notice that those descriptions are mostly the same. Mainly, most of the script file is just a list of commands to run. Commands which are the same between DOS and Unix, like "cd ..", or the names of executable files within the PATH, may work equally well with both types of files.
If you had a Unix script file that said:
#!/bin/sh
@Echo Off
echo hello
cd .
more < readme.txt
Then the first line of the file would cause a harmless error in DOS/Windows, the second line of the file would cause a harmelss error message in Unix, and the rest of the file could work identically in both environments.
Whether this will actually work well for you, or not, may largely depend on what commands you use. For instance, "cd bin
" can work well with both environments, but DOS/Windows use a backslash as a directory separator while Unix uses a forward slash. So some commands may not work well.
The best way for us to predict how well your particular batch file would work well, or not, is if we knew the contents of the batch file. Hence why barlop's comment asked about the contents of the batch file.
Regarding your question (from one of your comments) on which extension to use: In DOS/Windows, the answer is ".BAT" (any amount of lowercase is fine, so ".bat" is okay too.) In Unix, the most common standards are "none" (no extension), or ".sh
". However, in Unix, the extension really doesn't matter significantly. What matters is whether the file has the necessary permissions, and possibly whether it starts with the appropriate header. So make sure those things are right. (The header is the first line shown in my prior sample. The permissions can be set using "chmod a+x filename.bat
" but, of course, specify the actual location of the filename.) When you run the file in Unix, make sure to specify the entire filename of the script file, including the ".bat" extension. (If you don't like doing that, simply make a symlink, having a symlink named "gonow" point to "gonow.bat" (or whatever is approrpriate).
The other way to do this in Unix is to run the .BAT file from within another piece of software which is DOS-like. e.g., COMMAND.COM within Wine, or perhaps CMD.EXE within WINE, or other Wine variants like Crossover, or other software like DOSBox or DOSemu. If you do so use this software that is designed to work quite like DOS, then that software may be able to run the file without requiring that you specify the ".bat" extension.
Another alternative may be to simply use a Shell Script file that runs Java (since the contents of the batch file, mentioned elsewhere, show Java being run), and ignore trying to use a file that ends with the ".bat" extension. (So it wouldn't be a .bat file, but would be a shell script or a symbolic link.)
perhaps there is some converter, but you should add a bit about where you got this .bat file and what is in it – barlop – 2016-05-15T22:37:46.143
It's just a launcher for a minecraft tekkit server I used to play all time. I created it with textedit and it used to work – Greg – 2016-05-15T22:40:34.653
i'm not familiar with mindcraft.. But are you aware that Macs since they run OSX would not execute windows batch files, they have their own BSD based shell, which has languages like bash or ksh, not batch. And the batch file aside, the minecraft server executable that runs on windows won't run on mac, you'd need a minecraft server executable that was compiled for mac (or something on the mac that can simulate a windows machine, and run the minecraft server) – barlop – 2016-05-15T22:42:49.377
That's the thing though, it used to work just fine and open in command center even though it has a .bat extension. It changed when I switched to El Capitan – Greg – 2016-05-15T22:44:30.707
you should add that point you just made into your question – barlop – 2016-05-15T22:45:16.970
So what should I do? – Greg – 2016-05-15T23:57:23.787
Fantastic that you included the contents. Linux doesn't look at extensions. and in terms of file type, that might work as a *nix shell script too. You should include the error message when you tried to run that. (and then google the error message, and see what google says of that error message). e.g. it might be a permissions issue(chmod required), or it might be java needs to be installed. Or it might be your jar file doesn't exist at that location – barlop – 2016-05-17T13:58:23.043
I think quite possibly your
.bat
file wasn't running as a bat file but the contents would work as either a batch file or a *nix shell script. what happens if you dochmod 777 blah.bat
and then run the command? (assuming you have java installed and the jar file there).. it might work – barlop – 2016-05-18T04:29:31.647Thanks @barlop for pointing out that I was missing the -jar option (answer edited). OP, try running the first line "java -Xmx3G -Xms2G -jar Tekkit.jar noggin" without the pause and change Tekkit.jar to the full path, eg: ~/my-java-stuff/Tekkit.jar or try running the path to the minecraft file (apparently, according to the web, it's this): "~/Library/Application Support/minecraft/bin/minecraft.jar" – nonzyro – 2016-05-18T10:48:17.317
@nonzyro superuser/stackoverflow/ stackexchange sites can be really stupid with formatting.. he had put pause on a new line. Nevertheless, indeed, the pause line shouldn't be there. since running it as a bash script is what he was probably doing anyway. Worth noting that the pause wouldn't be the error he describes though. Though he doesn't describe the error much. He really needs to give the error message. – barlop – 2016-05-18T10:59:43.153
-1 Give the error message when you try to run your 'script'. (And when you try to run the one line command from a terminal). You haven't even stated the error. Stating that something doesn't work is completely insufficient. – barlop – 2016-05-18T11:02:08.543