gpt4 book ai didi

java - GWT 编译器找不到 javax 库

转载 作者:行者123 更新时间:2023-11-30 09:42:20 25 4
gpt4 key购买 nike

我是 GWT 的新手,正在尝试运行我的第一个 GWT 应用程序。我有使用 javax.persistence 包中的 API 的类。当我尝试使用 GWT 编译器编译代码时,由于无法在类路径中找到提到的包而失败。不过,我已将库添加到类(class)中。

<property name="gwt.sdk" location="C:/gwt-2.4.0" />
<!-- Arguments to gwtc and devmode targets -->
<property name="gwt.args" value="" />
<path id="gwt.class.path">
<fileset dir="${devLib}"> <!-- here is all the dependent libraries-->
<include name="*.jar" />
</fileset>
<pathelement location="${gwt.sdk}/gwt-user.jar"/>
<fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
</path>

<target name="gwtc" description="GWT compile to JavaScript (production mode)">
<echo message="${gwt.class.path}"/>
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<path refid="gwt.class.path"/>
<pathelement location="gwt/project/src"/>
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<arg line="-war"/>
<arg value="web/five/gwtUI"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="org.scheduling.Scheduling"/>
</java>
</target>

这是我在运行 ant 目标 gwtc 时看到的错误。有人可以帮我改正吗?

[java] Compiling module org.scheduling.Scheduling
[java] Validating newly compiled units
[java] Ignored 91 units with compilation errors in first pass.
[java] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[java] Computing all possible rebind results for 'com.google.gwt.user.client.UserAgentAsserter'
[java] Rebinding com.google.gwt.user.client.UserAgentAsserter
[java] Checking rule <generate-with class='com.google.gwt.editor.rebind.SimpleBeanEditorDriverGenerator'/>
[java] [WARN] Detected warnings related to 'com.google.gwt.editor.client.SimpleBeanEditorDriver'. Are validation-api-<version>.jar and validation-api-<version>-sources.jar on the classpath?
[java] Specify -logLevel DEBUG to see all errors.
[java] [WARN] Unknown type 'com.google.gwt.editor.client.SimpleBeanEditorDriver' specified in deferred binding rule
[java] Scanning for additional dependencies: file:/C:/Tolven_skandula/org.component.scheduling/gwt/project/src/org/scheduling/gwt/common/client/SchedulingEntryPoint.java
[java] Computing all possible rebind results for 'org.scheduling.common.service.SchedulingService'
[java] Rebinding org.scheduling.common.service.SchedulingService
[java] Checking rule <generate-with class='com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator'/>
[java] [ERROR] Errors in 'file:/C:/Tolven_skandula/org.component.scheduling/gwt/project/src/org/scheduling/common/model/Appointment.java'
[java] [ERROR] Line 5: The import javax.persistence cannot be resolved
[java] [ERROR] Line 6: The import javax.persistence cannot be resolved
[java] [ERROR] Line 7: The import javax.persistence cannot be resolved
[java] [ERROR] Line 8: The import javax.persistence cannot be resolved
[java] [ERROR] Line 9: The import javax.persistence cannot be resolved

最佳答案

看看http://code.google.com/intl/de-DE/webtoolkit/doc/latest/RefJreEmulation.html ,它描述了正在模拟的标准 JRE GWT 中的类。似乎不支持 javax.persistence。

gwt 就是这样。仅支持标准 JRE 的一小部分(因为 JavaScript 永远不会具有相同的功能,因为它在浏览器环境中运行)。此外,虽然谷歌人员正在尝试集成越来越多的类,但他们的速度只有那么快。

但您始终可以创建自己的类和库。

关于java - GWT 编译器找不到 javax 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8737544/

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