学习Spring基于注解的装配,报错Unsupported class file major version 62

上课时,老师在讲基于注解的装配,用自己的电脑敲的代码,明明一样的代码,可是一运行就会出现

上网搜了搜解决办法,并写下了这篇文章

原因是JDK的版本太高了,我用的是18,最后改成一个常用的JDK8,便OK啦

1.首先需要有一个低版本的JDK

可以到官网去下载(需要有个Oracle账号),我以JDK8为例,下载地址在这儿

https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html

网页向下拉,选择相应的版本下载就OK,我用的是windows系统,便下载了这个

注意上面有个小锁,需要注册一个Oracle账户登陆一下

2.下载过之后进行安装

双击进行安装就可以,如果忘记怎样操作的话,可以到网上搜一下JDK8下载安装教程,很简单的,可以看这个(只看安装部分就可以)【保姆级】jdk8安装与下载教程-新手必会(提供下载地址)_jdk8免费下载-CSDN博客

3.安装后需要配置环境变量

一台电脑上是可以安装多个版本的JDK的,如果想保留原来的JDK,可以这样配置环境变量

鼠标右键点击此电脑,弹出下面的框,点击属性

弹出一个页面,在该页面中找到下面的高级系统设置,点击

弹出下面的框,点击环境变量

在系统变量中配置三个JAVA_HOME,第一个JAVA_HOME是为了控制当前使用的是哪个版本的(我当前是JDK8,也就是JDK1.8),可以实现版本的自由切换(在命令窗口中),后两个是对应着不同版本的JDK

之后找到系统变量中的Path,双击Path

在弹出的页面中添加下面两个

注意:不要将带%的移置到最上面,这样会导致环境变量Path点击编辑展不开,若出现此问题了,可以看这篇文章(没出现就不用看了)环境变量Path点击编辑不展开解决办法_编辑系统变量path为啥不展开了-CSDN博客

配置好了之后,可以在命令行中试一试,若出现以下情况,则JDK安装配置成功

4.到IDEA中进行配置

(1)首先,先改一下该项目的JDK版本,点击文件,找到项目结构点击,如下图

(2)之后找到SDK并点击,再点击右侧左上角的+,添加新安装的JDK8,如下图

(3)在弹出的框框中,配置你安装JDK路径,配置好是下面的样子,多了一个1.8(这就是JDK8)

(3)再到项目中,修改SDK,配置成刚刚添加的JDK1.8,如下图

(4)再到模块中,修改模块的SDK,改成JDK8,也就是JDK1.8,然后点击应用,再点击确定

(5)这时候我们,看下面这个地方,在pom文件下面

若仍然是18(这里显示的是JDK版本)的话,我们到项目结构中再看一下,如下图

我们可以重新操作一下上一个步骤,如下图

之后我们会发现变成1.8了,如下图

(6)不急,还没有好,我们到pom文件中,改一下下面这两个地方

改成8,要不然运行时会出现以下错误

(7)在运行代码前最好刷新一下maven,有时候配置好了还有问题,刷新一下maven就可以解决,如下图

点击Maven,左侧便会出现上图所示样子

(8)我们可以到设置中去看一下这个地方,如下图

看目标字节码版本是不是我们刚改的1.8,不是的话改过来

(9)为保险起见,还可以查看一下下面这个,这个是测试代码的时候用的Java版本

点击编辑配置会弹出下面这个界面,看看是不是java8,不是的话改一下

(10)这样就OK啦

  • 18
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
WAK Productions Presents: TRegware Shareware Security Component for Delphi Version 4.02 Copyright ?003 - WAK Productions ------------------------------------------------ Programmed by Winston Kotzan Email: [email protected] Website URL: http://www.wakproductions.com/ This program helps developers of shareware include a timebom b/registration for their program. The end-user will enter a License ID and a serial number (like Winzip). If their registration information is correct, then the program becomes registered. TRegware hides data in the Windows registry to check if program was registered. If you have any difficulties using this component, suggestions, or compliments about this component, I would be glad to hear them! Please send an Email to [email protected]. The more user responses received, the more TRegware can be improved to keep it the best shareware security component for Delphi developers! IF YOU HAVE A TECHNICAL QUESTION, PLEASE READ FAQ.TXT BEFORE SENDING AN EMAIL. THANK YOU! Release Notes ------------- Version 4.00 - NOTE THAT THE TREGWARE 4.00 ALGORITHM IS INCOMPATIBLE WITH PREVIOUS VERSIONS - New and revised demo programs included in distribution package Major revisions: - New feature allows an expiration date to be included in the registration code. This would help prevent the illegal spread of codes over a period of time. If a user enters a registration code beyond the expieration date, TRegware will not accept the code. - Now uses completely different, more secure algorithm. The registration code now consists of a combination of several code generating algorithms to make it harder for crackers to create keygens. - The TRegware class can no longer generate its own registration codes. To create registration codes use the TRegCodeGenerator class. (See demo program) - Now has option to use an expiration date in code. Check the documentation for more information. - Class name has been changed from TRegwareII to TRegware4 because of incompatibilities with past versions. - The TRegware class no longer has the ability to generate registration codes. The program now uses the function named E89CE8E0 to verify codes. Minor revisions: - Removed hard drive serial number related LicenseSource options. It was unreliable under Windows XP. - If the registry data is corrupted or unrecognized TRegware sets itself unregistered Version 3.20: - A set of compiler-time options are now available in the unit reg_opts.pas It is suggested to configure this file for each of your programs for greater security. Please read the comments in reg_opts.pas for further description. - Added Email property to contain user's email address. See DoRegistration() function documentation for details. - Licensing options (LicenseType, LicenseSource properties) have been moved to a special class, TLicenseOptions. They will now appear under the LicenseOptions property. LicenseOptions are only available in the professional edition. Version 3 of TRegware includes many features to improve its flexibility and security. In particular, TRegware has been modified to operate on Windows 2000 and XP systems. New features in version 3.0: - FSeed is now encrypted to protect from hackers. To turn this option off, remove the '$DEFINE HIDE_SEED' line from regware2.pas. Having this option on may cause TRegware to not recognize already existing registrations from previous versions. (Only available in source code edition) - Windows 2000 / XP registry is now supported. Information is stored under HKEY_CLASSES_ROOT for 2000/XP systems. - New ban-list features allows you to ban certain users from using the next version of your software - Added 1 second-delay for registration attempts to prevent cracking by brute-force. This option does not have a property to disable it so that it is a little more difficult to patch. - Added spaghetti code in CalculateCode() for the purpose of confusing hackers - Option to use system-generated license id (uses Windows system ID or hard drive serial #) - Option to set site-licenses and single-user licenses. New features in version 2.0: -Detects if the user attempted to deceive the timebomb by setting their computer's clock backwards. In this case, the component will signal an OnClockChange event and report that the program has expired. When the user decides to put his clock back within the remaining 'x' days of his evaluation period, the timebomb will continue to operate. -TRegware now comes packaged with a Perl file (regware200.pl) so that registration codes can be generated on a UNIX-based web server. You can use the Perl script if you would like to give registration codes to customers via a CGI program. Bug reports? Suggestions? Comments? Email to: [email protected] or visit website http://www.wakproductions.com/

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值