Batch (SH) files for Windows batch processing (BAT) files converted to Mac
1. bat converted to SH file, write off Echo, title field;
2. Place the '; ' in the bat file Replace the delimiter with ': ';
MAC Add Java Environment variables
1. Open the terminal input CD ~
niko:~ mmk$ open-e. bash_profile
Open a. bash_profile file for editing;
2. Add in. bash_profile
Java_home= '/usr/libexec/java_home '
Export Java_home
Export Path=${path}: $JAVA _home/bin: $JAVA _home/jre/bin
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar:/javafile
Save and close;
3. In the terminal, enter source. Bash_profile is used to save the file and make it effective;
The test path can be printed correctly at the terminal, input echo $JAVA _home/$CLASSPATH See if the path printed is correct;
4. Restart the terminal in the Javafile directory to run Java files, the normal operation is OK;
Note: Be sure to run Java in the upper folder of the file, or you will get an error Error: The main class could not be found or could not be loaded;
Mac adds Java environment variable success, still error: The main class could not be found or could not be loaded