简体   繁体   English

Java 8的Java 7 sun。*类

[英]Java 7 sun.* classes with Java 8

I am using some library which inside itself use sun.security.* classes. 我正在使用一些本身在内部使用sun.security。*类的库。 And I'm using it as dependency in my project which is java 8. In java 8 some methods removed from sun classes which my library need. 我将其用作Java 8项目中的依赖项。在Java 8中,我的库需要从sun类中删除某些方法。

I understand that messing up with sun.* packages is not good idea, but I don't want to downgrade my project to java 7, so is there any workaround to make my project run in java 8 environment, but use sun.* classes from java 7 ? 我知道弄乱sun。*软件包不是一个好主意,但是我不想将项目降级到Java 7,因此是否有任何变通办法可以使我的项目在Java 8环境中运行,但是要使用sun。*类从Java 7开始?

... is there any workaround to make my project run in java 8 environment, but use sun.* classes from java 7 ? ...是否有任何变通办法可以使我的项目在Java 8环境中运行,但使用来自Java 7的sun。*类?

The missing method is part of the SSL implementation, and it looks like there have been major rewrites in Java 8. (For good reason, IIRC.) 缺少的方法是SSL实现的一部分,并且似乎在Java 8中进行了重大重写。(有充分的理由,IIRC。)

Is there a simple workaround? 有没有简单的解决方法?

Probably not. 可能不是。 It would entail messing around with the SSL implementation, and that is risky, even if you can get the code to run. 即使您可以运行代码,这也将使SSL实现陷入混乱,这是有风险的。

A couple of better ideas would be: 几个更好的主意是:

  • Port the 3rd-party library that is causing you problems to Java 8. (Or pay someone else to do it for you.) 将导致您出现问题的第3方库移植到Java8。(或请其他人代为完成。)

  • Change it to use a different OAuth2 API. 更改它以使用其他OAuth2 API。 There are some leads here: http://oauth.net/2/ 这里有一些线索: http : //oauth.net/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM