After pressing Enter, your program will be executed. If the machine reports an error or the program encounters an error while running, continue to perform the troubleshooting procedure (troubleshooting) below.
1. Set up the path
If you want to launch a simple program with all files in the same folder, you don't need to do this. However, if you are launching a more complex program with files located in different folders, you need to let your computer know where to find these files.
java -version
command into the Command Prompt window and press Enter. Based on the version of Java displayed in the first line, enter the code set path=%path%;C:Program FilesJavajdk1.5.0_09bin
into the command line and press Enter . Replace jdk1.5.0_09
with any version of Java you have installed. Make sure you are entering this command in the correct directory for your Java project./usr/libexec/java_home -v 1.7
in the Terminal window and press Enter to make sure Java is installed on the system. Next, enter the code echo export "JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile
at the command prompt and press Enter . Then restart Terminal.Refer to some more articles:
Having fun!