gpt4 book ai didi

java - 如何在我的 jar eclipse 中引用第 3 方 jar

转载 作者:太空宇宙 更新时间:2023-11-04 13:42:22 26 4
gpt4 key购买 nike

我正在为我的 Android 应用程序创建一个插件,这是我的第一次尝试。我想在我的 jar 中使用 org.eclipse.jdt.core-X.X.X.jar。但是我遇到了这个错误:-

06-30 11:30:27.930: I/Unity(13847):   AndroidJavaException: java.util.MissingResourceException: Can't find resource for bundle 'org.eclipse.jdt.internal.compiler.batch.messages_en_IN', key ''
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.AndroidJNISafe.CallVoidMethod (IntPtr obj, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.AndroidJavaObject._Call (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.AndroidJavaObject.Call (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at TestScript.CallTheFunction () [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
06-30 11:30:27.930: I/Unity(13847): at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0

我将 jar 和 org.eclipse.jdt.core-x.x.x.jar 放在 unity 的 Plugins\Android 文件夹中。根据错误,我需要在类路径中添加 org.eclipse.jdt.core.jar 但我不知道如何。

最佳答案

我想您的意思是在您的项目中添加一个库,如果您右键单击您的项目并转到“Java Build Path”,然后转到“Libraries”选项卡,单击“AddExternal JARs”并选择您的 jar 文件,则可以轻松完成此操作。

我建议您将该 JAR 放在项目文件夹中。

另请查看:https://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F

Open the context menu on the project, and select Properties > Java Build Path > Libraries. From here, you can add JAR files to the build path, whether they are inside your workspace or not. You can also add a class folder, a directory containing Java class files that are not in a JAR. Note that plug-in development has more restrictions on where build path entries can come from. For plug-in projects, you should always let the plug-in development tools organize your build path for you. Simply select the plugin.xml file, and choose PDE Tools > Update Classpath from the context menu.

另外,在使用它时不要忘记进行导入。

关于java - 如何在我的 jar eclipse 中引用第 3 方 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31130874/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com