我已经在Mac OS X上安装了JDK 1.8.0_25。当尝试编译Java8源代码时,它会抱怨:
> javac -source 1.8 ComposableList.java
javac: invalid source release: 1.8
> which javac
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/javac
> java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
> javac -version
javac 1.7.0_60
> which java
/usr/bin/java
> which javac
/usr/bin/javac
> /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/bin/javac -version
javac 1.7.0_60
> /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/javac -version
javac 1.7.0_60
> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/javac -version
javac 1.7.0_60
编辑3:正如@dan所建议的,是否所有javac都是指向单个javac的符号链接?不,原来没有符号链接:
>ls -l /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/javac
-rwxrwxr-x 1 root wheel 99376 Sep 17 17:13 /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/javac
> ls -l /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/javac
-rwxrwxr-x 1 root wheel 99360 Mar 18 2014 /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/javac
答案如下:https://stackoverflow.com/a/22547808/130228。结果是,javac如果找到~/library/java/extensions/tools.jar就执行它。所以删除~/library/java/extensions就可以了。
感谢https://stackoverflow.com/users/3439760/user3439760为我找到答案,感谢Franco Azabache为我找到链接。
当我做,与: 配置摘要: 调试级别:fastdebug HS调试级别:快速调试 JVM变体:服务器 JVM特性:服务器:'aot cds cmsgc编译器1编译器2 dtrace Epsilong C g1gc graal jfr jni检查jvmci jvmti管理nmt并行GC串行GC服务vm结构' OpenJDK目标:操作系统:macosx,CPU架构:x86,地址长度:64 版本字符串:1
以下是代码(假设id和速度已经初始化,并且包含的内容正确):
编译单个 package: make package/<pkg_name>/compile 清楚单个 package: make package/<pkg_name>/clean 可以这样顺序执行 clean 和 compile: make package/<pkg_name>/{clean,compile}
编译 uboot: make package/uboot-leo/compile 清除 uboot: make package/uboot-leo/clean 拷贝 uboot 到编译生成目录 make package/uboot-leo/install 顺序执行 uboot 的 clean,compile,install make package/uboot-leo/{clean,comp
修改公共的 kernel 配置: make kernel_menuconfig 编译 kernel: make target/linux/compile 清除 kernel: make target/linux/clean 拷贝 kernel 到编译生成目录 make target/linux/install 顺序执行 kernel 的 clean,compile,install make
拷贝默认配置: cp configs/leo_gx8010_ssd_1v_defconfig .config 加载默认配置: make defconfig 修改 openwrt 配置: make menuconfig 编译: make 如果想加快编译速度,请加-j 参数使用多线程编译 如果想查看详细编译信息,请加 V=s 参数打印编译 log 清理 packages,kernel,uboo