我们在Windows 7 Enterprise,SP1,64bit上运行.我们刚刚在所有机器上安装了Java 7,这会导致以下问题:
当我的程序尝试从Quality Center与OpenTestArchitecture-API进行通信时,无法创建ActiveX-Component.我使用JACOB作为我的Java-COM库.升级到最新版本的JACOB并没有改变任何东西.
以下测试适用于jdk1.6.0_24(32位)但使用jdk1.7.0_04(32位)失败:
import java.io.File;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.LibraryLoader;
public class JacobTest {
static {
File lib = new File("lib/" + LibraryLoader.getPreferredDLLName() + ".dll");
System.setProperty(LibraryLoader.JACOB_DLL_PATH, lib.getAbsolutePath());
System.out.println("JACOB_DLL_PATH = " + lib.getAbsolutePath());
LibraryLoader.loadJacobLibrary();
}
public static void main(String[] args) {
try {
// Excel: Works with jdk1.6.0_24 AND jdk1.7.0_04
System.out.println("new ActiveXComponent(\"Excel.Application\");");
new ActiveXComponent("Excel.Application");
// Quality Center OTAClient: Only works with jdk1.6.0_24
System.out.println("ActiveXComponent component = new ActiveXComponent(\"TDApiOle80.TDConnection\");");
ActiveXComponent component = new ActiveXComponent("TDApiOle80.TDConnection"); …Run Code Online (Sandbox Code Playgroud) 我使用wsimport maven插件生成一些来自WSDL文件的类@ Mule Anypoint Studio 3.5 with JDK 1.7_55
我正在使用jaxb 2.2.7并从mule libs中删除2.1.9版本并替换为2.2.7.
当我编译时,sometines工作正常,但其他我多次采取此错误:
The attribute required is undefined for the annotation type XmlElementRef
Run Code Online (Sandbox Code Playgroud)
我试图在JDK中创建一个支持的文件夹,并包含.jars,
你知道如何避免这个错误或正确替换这个库吗?
我在pom.xml中包含了这个依赖项
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.7</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.7</version>
</dependency>
<!-- xjc -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2.7</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>idlj-maven-plugin</artifactId>
<version>1.2.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
wsimport是2.2.7到
wsimport设置:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>wsdl-AMANSequenceService-exec</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<args>
<arg>-version</arg>
<arg>-B-nv</arg>
<arg>-Xdebug</arg>
<arg>-B-XautoNameResolution</arg>
<arg>-Xendorsed</arg>
</args>
<extension>true</extension>
<sourceDestDir>${basedir}/src/main/java</sourceDestDir>
<destDir>${basedir}/src/main/java</destDir>
<extension>true</extension>
<wsdlDirectory>${basedir}/src/main/resources/SICG/AMANSequenceService</wsdlDirectory>
<wsdlFiles> …Run Code Online (Sandbox Code Playgroud) 这个SO答案澄清了有关-XmxJVM标志的一些事情.试着尝试我做了以下事情:
import java.util.List;
import java.util.ArrayList;
public class FooMain {
private static String memoryMsg() {
return String.format("%s. %s. %s"
, String.format("total memory is: [%d]",Runtime.getRuntime().totalMemory())
, String.format("free memory is: [%d]",Runtime.getRuntime().freeMemory())
, String.format("max memory is: [%d]",Runtime.getRuntime().maxMemory()));
}
public static void main(String args[]) {
String msg = null;
try {
System.out.println(memoryMsg());
List<Object> xs = new ArrayList<>();
int i = 0 ;
while (true) {
xs.add(new byte[1000]);
msg = String.format("%d 1k arrays added.\n%s.\n"
, ++i
, memoryMsg());
}
} finally { …Run Code Online (Sandbox Code Playgroud) 我在我的Android应用程序中使用Jackson 2.8.2来反序列化JSON.反序列化本身可行,但是,我可以在应用程序日志中看到以下警告:
Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
Run Code Online (Sandbox Code Playgroud)
Proguard被禁用,sourceCompatibility设置为'1.7'.如何在构建中添加这些看似缺失的类型?
我用Java 1.7创建了一个Java应用程序我的问题是它没有在Windows 2000上运行.它说我"这不是WIN-32应用程序".
如何在其上运行我的应用程序?
当我尝试使用maven-jaxb-schemagen-pluginjava 7时
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
[ERROR] Failed to execute goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate (default) on project TopologyProvisionerDom: Execution default of goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate failed: A required class was missing while executing com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate: com/sun/mirror/apt/AnnotationProcessorFactory
Run Code Online (Sandbox Code Playgroud)
好像AnnotationProcessorFactory在Java 7中被删除/弃用了?有可能让jaxb schemagen使用这个插件工作吗?在使用JDK 7时,是否有另一种方法可以从JAXB源代码生成模式?
我的java版本是:
Java Plug-in 10.3.1.255使用JRE版本1.7.0_03-b05 Java HotSpot(TM)客户端VM
所以当我有版本6.x一切都很好,升级后我得到了这个:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: This function should be called while holding treeLock
at java.awt.Component.checkTreeLock(Component.java:1196)
at java.awt.Container.validateTree(Container.java:1682)
at pl.recorder.ScenarioWindow.showUploadPanel(PlayerWindow.java:721)
at pl.recorder.actions.UploadFilesAction.execute(DesignFilesAction.java:71)
at pl.recorder.actions.EndTestAction.actionPerformed(EndTestAction.java:91)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at … 在我的公司,我们下载并启动了一个与JRE 1.6.0_20绑定的JNLP应用程序.我们使用系统缓存功能下载JAR.
当我们在PC上安装JRE 1.7时,WebStart无法启动.当我们启用日志时,我们会看到以下异常:
java.lang.ExceptionInInitializerError
at com.sun.deploy.net.protocol.https.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.createUrlConnection(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCachedFile(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: sun.security.ssl.X509TrustManagerImpl cannot be ast to com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager
at com.sun.deploy.security.X509ExtendedDeployTrustManager.<init>(Unknown Source)
at com.sun.deploy.net.protocol.https.Handler$Initializer$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.net.protocol.https.Handler$Initializer.<clinit>(Unknown Source)
... 16 more
Run Code Online (Sandbox Code Playgroud)
有一个已知的解决方法吗?
我使用的是JDK 7和Netbeans IDE 7.1.2.通过走出去的开关使用字符串
试图在我的IDE中编译该示例示例,但我收到此错误.
switch(month.toLowerCase()){(使用-source 7或更高版本来启用交换机中的字符串)1错误
需要你的帮助.
谢谢
我正在为MAC和Windows开发一个javaFx应用程序,我发现该应用程序在MAC中使用的是非常大的内存和CPU使用率.
当我在Windows任务管理器中看到我的应用程序活动时,它显示平均80MB内存和1-2%CPU的使用率,最大可达150MB和12-15%CPU.另一方面,在MAC Activity Monitor中,相同的应用程序在启动时显示150MB和12-15%的CPU,并且持续增加超过1GB和90%的CPU.
这是我在JavaFX应用程序中发现的一个非常奇怪的问题.
我甚至测试了这个简单的java应用程序,并发现在MAC和Windows中内存和CPU的类似行为.
为什么Java在MAC中使用更多内存和CPU?有什么可以解决这个问题的原因吗?