简体   繁体   English

我可以在 java-11 spring boot 2 项目中使用 java-8 编译的项目/库吗?

[英]Can I use java-8 compiled project/library in a java-11 spring boot 2 project?

Maybe a stupid question, I am in a process of upgrading bunch of our frameworks/libraries to java 11. I have this 1 project (Project Dep) that is a dependency of another project (Proj X).也许是一个愚蠢的问题,我正在将我们的一堆框架/库升级到 java 11。我有这个 1 项目(Project Dep),它是另一个项目(Proj X)的依赖项。 Both are java 8 and to be upgraded to Java 11.两者都是 java 8 并将升级到 Java 11。

However, both projects are big and might take days to be done, the Proj D is considerably larger (and used by a lot of devs) than Project X using it.然而,这两个项目都很大,可能需要几天时间才能完成,Proj D 比使用它的 Project X 大得多(并且被许多开发人员使用)。 I am thinking just upgrading the Proj X to java 11 and spring boot 2, and use the java 8 version of Proj D.我正在考虑将 Proj X 升级到 java 11 和 spring 启动 2,并使用 java 8 版本的 Proj D。

Will that work?那会奏效吗? I am asking just to have a clear path on what should I do in order and prioritize.我只是要求对我应该按顺序和优先级做什么有一个清晰的路径。

Yes, you could use the Project D(dependency Java 8) in Project X(Java 11) also Check for deprecation of packages in Java 11 and make sure you update the deprecated packages in Java 8 Project. Yes, you could use the Project D(dependency Java 8) in Project X(Java 11) also Check for deprecation of packages in Java 11 and make sure you update the deprecated packages in Java 8 Project. Or If you want to upgrade both to Java 11 not a problem.或者如果你想同时升级到 Java 11 没问题。 Consider your time and Upgrading is always a better option.考虑您的时间,升级始终是更好的选择。

It doesn't matter what version the project is in, it matters what version the JVM that will run it is.项目的版本无关紧要,运行它的 JVM 的版本很重要。 It must be at least the version of any of the dependencies.它必须至少是任何依赖项的版本。

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

相关问题 如何在java-11中运行(exe)java-8应用程序 - How to run (exe) java-8 application in java-11 如何使用FOP和Java-11设置Maven项目? - How to setup a maven project using fop and java-11? 用于 Spring 启动项目的 AWS beanstalk 上的 Java 11 - Java 11 on AWS beanstalk for Spring boot project 普通Java项目中的Spring Boot库用法 - Spring Boot library usage in plain Java project 将现有 Spring 引导项目从 java 1.8 更新到 java 11 - Update existing Spring Boot project from java 1.8 to java 11 我可以使用在 Java 7 中编译的 jar 作为针对 Java 6 编译的项目中的依赖项吗? - Can I use a jar, compiled in Java 7 as a dependency in a project that is compiled against Java 6? Java-11 spring-boot 部署到谷歌云错误:应用程序不满足 [java11] 的要求 - Java-11 spring-boot deployment to google cloud error: app does not satisfy requirements for [java11] 如何使用Spring-Boot在Java项目中使用Clojure库? - How can I use Clojure libraries in a Java project, using Spring-Boot? 无法在 Java 上使用 JSTL 导入标记库 11 Spring 引导项目 - Unable to import taglibs using JSTL on Java 11 Spring Boot project 我可以在 Android 商业项目中使用 java 11 吗? - Can I use java 11 in Android commercial project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM