Starting *.bat files on Mac?

Hi,


Does anyone know if .bat files could be ran on Mac OS, or made into *.sh files?


For example:

*.config

#
#Thu Jul 14 12:42:09 EEST 2016

J_START=C\:\\VersusERP2\\versuserp2.bat

V_CLIENT_BASE_OUTPUT=C\:\\rmics_client\\projects\\versus-client-base

J_SERVER_OUTPUT=C\:\\\projects\\jars\\old\\lib

V_UI_OUTPUT=C\:\\\projects\\jars

SERVERIP=192.168.18.88

MONITOR=1

G_OUTPUT=C\:\\\projects\\jars\\old

G_SERVER_OUTPUT=C\:\\\projects\\jars\\old\\lib

J_OUTPUT=C\:\\\projects\\jars\\old

V_CORE_OUTPUT=C\:\\\projects\\jars

V_CLIENT_BASE_START=C\:\\rmics_client\\projects\\versus-client-base\\versus.bat

V_SERVER_BASE_OUTPUT=C\:\\\projects\\jars

MAKE=1

JDK_HOME=C\:\\Program Files\\Java\\jdk1.8.0_77

*.bat

start javaw -cp "rmics.jar" client.ClientPanelFrame CONFIG_FILE=client.conf

MacBook Air, OS X El Capitan (10.11.6), null

Posted on Oct 12, 2016 4:30 AM

Reply
3 replies

Oct 12, 2016 5:57 AM in response to shark_tale1

The answer is no. BAT files short for 'batch command' files are scripts to automat a series of steps on Windows computers. (Arguably one could also say they are for MS-DOS computers.)


The Mac has an equivalent to a BAT file which is a Unix shell script, usually having .sh as its file extension however the syntax of commands is totally different. (The Mac also has its own scripting language called AppleScript as well.)


It is possible to run Windows on a Mac in various ways, the most common way is via 'virtualisation' which runs Windows in a virtual machine environment at the same time the host Mac operating system is running. There are several choices of software to do this including VMware Fusion, Parallels Desktop, and Virtualbox. It is also possible to install Windows on a separate partition and boot natively in to Windows in which case the Mac is then exactly the same as a real Windows PC.


From a brief scan of the example you provided it looks like it is something to do with running Java software on Windows. Java being platform independent runs on Linux, Mac and Windows. Some Java applications come with scripts and/or config files to set themselves up better for a particular operating system but in theory they could be run manually as well. Look for a .sh file instead. Often on a Mac to run a Java application you simply double-click on the .jar file.


Note: Neither Mac or Windows or Linux actually come with Java pre-installed so you would still need to install Java from the Oracle/Java website. (Oracle own Java.)

Oct 12, 2016 6:23 AM in response to John Lockwood

Hi John,


Yes, I am trying to run a java application. I do have Java installed, and there's no shellscript file, since the application has been developed on Windows until now.


I tried running the command start javaw -cp "rmics.jar" client.ClientPanelFrame CONFIG_FILE=client.conf but it did not work, so i changed the "start" to "startup", but the same "command not found" message appeared.

I also tried running the *.jar file itself, but a message saying there's no main method appeared.

Is there a way to run that jar on my mac?

Oct 12, 2016 6:33 AM in response to shark_tale1

While the whole point of using Java is to be platform independent and therefore allow it to run equally well on Mac, Windows and Linux it has been my sad experience that too often some developers seem to go out of their way to defeat this. 😟 I have even seen Cisco do the heinous sin of wrapping a Java application inside a .exe file making it of course Windows only. 😮


javaw seems to imply the w stands for Windows. The usual command is simply 'java'. With regards to all the other parameters I have no idea what issues will arise with them.


I suggest you give the developer a good kicking and get him to provide it in a proper platform independent form or at least relevant instructions.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Starting *.bat files on Mac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.