When using maven to execute mvn eclipse in mac OS: eclipse, you can see a warning message in the log output on the command line to see the solution.
When using maven to execute mvn eclipse: eclipse in mac OS, a warning message is displayed in the log output on the command line. The information is as follows:
The Code is as follows: |
Copy code |
[WARNING] Workspace defines a VM that does not contain a valid jre/lib/rt. jar: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home |
The reason is that there is no rt in mac OS. jar file, with classes. the complete path of jar is/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes. jar, know the cause, it is easy to solve this problem, just need to make a soft link, the operation is as follows:
The Code is as follows: |
Copy code |
Cd/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Sudo mkdir-p jre/lib Sudo ln-s/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes. jar jre/lib/rt. jar |
If you are a root user, you can omit
The Code is as follows: |
Copy code |
"Sudo" |