Unsupported major.minor version

本文详细解析了Java编译器内部版本号与JDK版本之间的对应关系,帮助开发者理解Unsupported major.minor version错误信息的具体含义。从JDK1.4到JDK1.8,每个版本都有其独特的内部版本号标识。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 


48,49,50、51、52是Java编译器内部的版本号:
Unsupported major.minor version 52.0 对应于 JDK1.8(JRE1.8)

Unsupported major.minor version 51.0 对应于 JDK1.7(JRE1.7)

Unsupported major.minor version 50.0 对应于 JDK1.6(JRE1.6)
Unsupported major.minor version 49.0 对应于 JDK1.5(JRE1.5)
Unsupported major.minor version 48.0 对应于 JDK1.4(JRE1.4)

这是DronCAN的初始化函数,哪个是设置节点的函数void AP_DroneCAN::init(uint8_t driver_index, bool enable_filters) { if (driver_index != _driver_index) { debug_dronecan(AP_CANManager::LOG_ERROR, "DroneCAN: init called with wrong driver_index"); return; } if (_initialized) { debug_dronecan(AP_CANManager::LOG_ERROR, "DroneCAN: init called more than once\n\r"); return; } uint8_t node = _dronecan_node; if (node < 1 || node > 125) { // reset to default if invalid _dronecan_node.set(AP_DRONECAN_DEFAULT_NODE); node = AP_DRONECAN_DEFAULT_NODE; } node_info_rsp.name.len = hal.util->snprintf((char*)node_info_rsp.name.data, sizeof(node_info_rsp.name.data), "org.ardupilot:%u", driver_index); node_info_rsp.software_version.major = AP_DRONECAN_SW_VERS_MAJOR; node_info_rsp.software_version.minor = AP_DRONECAN_SW_VERS_MINOR; node_info_rsp.hardware_version.major = AP_DRONECAN_HW_VERS_MAJOR; node_info_rsp.hardware_version.minor = AP_DRONECAN_HW_VERS_MINOR; #if HAL_CANFD_SUPPORTED if (option_is_set(Options::CANFD_ENABLED)) { canard_iface.set_canfd(true); } #endif uint8_t uid_len = sizeof(uavcan_protocol_HardwareVersion::unique_id); uint8_t unique_id[sizeof(uavcan_protocol_HardwareVersion::unique_id)]; mem_pool = NEW_NOTHROW uint32_t[_pool_size/sizeof(uint32_t)]; if (mem_pool == nullptr) { debug_dronecan(AP_CANManager::LOG_ERROR, "DroneCAN: Failed to allocate memory pool\n\r"); return; } canard_iface.init(mem_pool, (_pool_size/sizeof(uint32_t))*sizeof(uint32_t), node); if (!hal.util->get_system_id_unformatted(unique_id, uid_len)) { return; } unique_id[uid_len - 1] += node; memcpy(node_info_rsp.hardware_version.unique_id, unique_id, uid_len); //Start Servers if (!_dna_server.init(unique_id, uid_len, node)) { debug_dronecan(AP_CANManager::LOG_ERROR, "DroneCAN: Failed to start DNA Server\n\r"); return; }
03-14
这是飞控中DronCAN的初始化函数,哪个是给其他设备设置节点语句void AP_DroneCAN::init(uint8_t driver_index, bool enable_filters) { if (driver_index != _driver_index) { debug_dronecan(AP_CANManager::LOG_ERROR, “DroneCAN: init called with wrong driver_index”); return; } if (_initialized) { debug_dronecan(AP_CANManager::LOG_ERROR, “DroneCAN: init called more than once\n\r”); return; } uint8_t node = _dronecan_node; if (node < 1 || node > 125) { // reset to default if invalid _dronecan_node.set(AP_DRONECAN_DEFAULT_NODE); node = AP_DRONECAN_DEFAULT_NODE; } node_info_rsp.name.len = hal.util->snprintf((char*)node_info_rsp.name.data, sizeof(node_info_rsp.name.data), "org.ardupilot:%u", driver_index); node_info_rsp.software_version.major = AP_DRONECAN_SW_VERS_MAJOR; node_info_rsp.software_version.minor = AP_DRONECAN_SW_VERS_MINOR; node_info_rsp.hardware_version.major = AP_DRONECAN_HW_VERS_MAJOR; node_info_rsp.hardware_version.minor = AP_DRONECAN_HW_VERS_MINOR; #if HAL_CANFD_SUPPORTED if (option_is_set(Options::CANFD_ENABLED)) { canard_iface.set_canfd(true); } #endif uint8_t uid_len = sizeof(uavcan_protocol_HardwareVersion::unique_id); uint8_t unique_id[sizeof(uavcan_protocol_HardwareVersion::unique_id)]; mem_pool = NEW_NOTHROW uint32_t[_pool_size/sizeof(uint32_t)]; if (mem_pool == nullptr) { debug_dronecan(AP_CANManager::LOG_ERROR, "DroneCAN: Failed to allocate memory pool\n\r"); return; } canard_iface.init(mem_pool, (_pool_size/sizeof(uint32_t))*sizeof(uint32_t), node); if (!hal.util->get_system_id_unformatted(unique_id, uid_len)) { return; } unique_id[uid_len - 1] += node; memcpy(node_info_rsp.hardware_version.unique_id, unique_id, uid_len); //Start Servers if (!_dna_server.init(unique_id, uid_len, node)) { debug_dronecan(AP_CANManager::LOG_ERROR, "DroneCAN: Failed to start DNA Server\n\r"); return; }
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值