MacOS环境下 JAVA+SAP+Android+Gradle环境变量设置
#JAVA环境变量配置 export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH #SAP_JCO环境变量配置 export DYLD_LIBRARY_PATH=/Library/sapjco3-darwinintel64-3.0.16 export CLASSPATH=$CLASSPATH:$DYLD_LIBRARY_PATH/sapjco3.jar #Android环境变量配置 export ANDROID_HOME=/Users/maple/Library/Android/sdk export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH #Gradle环境变量配置 export GRADLE_HOME=/usr/local/Cellar/gradle/4.10.2 export PATH=$GRADLE_HOME/bin:$PATH
特别注意:
- GRADLE_HOME变量的路径绝对不能包含空格,利用Android Studio安装的gradle,路径中包含了空格,虽然可以利用Android\ Studio(\转义)来解决,但是容易引发异常,建议重新选择路径安装gradle。
- SAP环境变量配置好之后使用Idea开发时,仍然报错找不到sapjco3.jar,这是由于idea并未识别$DYLD_LIBRARY_PATH/sapjco3.jar,需要手动在Project Settings => Platform Settings => SDKs => Classpath中添加sapjco3.jar