[英]How do I add a Maven dependency in VS Code for a simple Java project (i.e. an unmanaged folder without any build tools)?
I'm trying to build an AI model for the Mario-AI-Framework using the Deep Java Library (DJL).我正在尝试使用Deep Java 库(DJL) 为Mario-AI-Framework构建一个 AI model。 I'm using VS Code with the Java extension, as this is part of a larger project, mainly in Python. Now I have a Pytorch model trained and ready to go but I need the DJL Pytorch engine to load it in Java. The problem is, the only info I can find on how to import this thing uses Maven or they build it from source using Gradle .
I'm using VS Code with the Java extension, as this is part of a larger project, mainly in Python. Now I have a Pytorch model trained and ready to go but I need the DJL Pytorch engine to load it in Java. The problem是的,我能找到的关于如何导入这个东西的唯一信息是使用Maven或者他们使用Gradle从源代码构建它。 I'm not used to working with Java projects and importing libraries so I'm at a complete lost here.
我不习惯使用 Java 项目和导入库,所以我完全迷失在这里。 If anyone could point me in the right direction I would appreciate it.
如果有人能指出我正确的方向,我将不胜感激。
You can always download the jar files stored in the Maven repository and put them manually on your classpath.您始终可以下载存储在 Maven 存储库中的 jar 文件,并手动将它们放在您的类路径中。
Remember to do so recursively for all artifacts referred to until you have all the jar files that Maven would have downloaded for you.请记住对所有引用的工件递归执行此操作,直到您拥有 Maven 会为您下载的所有 jar 文件。
For instance if you need commons lang you can get 2.1 from https://search.maven.org/artifact/org.mod4j.org.apache.commons/lang/2.1.0/jar - note the Downloads link in the upper right.例如,如果您需要 commons lang,您可以从https://search.maven.org/artifact/org.mod4j.org.apache.commons/lang/2.1.0/jar获得 2.1 - 请注意右上角的下载链接.
You might find it easier to rework what you have into being a Maven project, so your tooling does it for you.您可能会发现将现有内容重新加工成 Maven 项目会更容易,因此您的工具会为您完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.