java-6

Is there a chance to get -splash:<image> work for SWT applications that require -XstartOnFirstThread?

这一生的挚爱 提交于 2019-12-24 00:14:46
问题 I am launching my Scala SWT application using: java -splash:splash.jpg -jar application.jar Using JDK 1.6.0 on Mac OS X 10.9.1 the splash screen was opened immediately (seconds before the actual application window opened). I used the following code to close the splash screen when the SWT application window opened: // When the window opens for the first time close the splash screen if exists val splash = SplashScreen.getSplashScreen if (splash != null) { shell.addShellListener(new ShellAdapter

Java 6, JFrame stuck alwaysontop

倖福魔咒の 提交于 2019-12-23 04:03:06
问题 This issue only seems to occur since I upgraded from 1.5 to 1.6 The main JFrame, randomly seems to get stuck infront of every other application in windows. Even another JDialog popping up set to alwaysontop(true) will be behind this main JFrame. Any ideas on what could be causing this issue? / Any ideas for solutions? Never had this issue before on Java 5. 回答1: Sorry guys it seems it was a program used as a screen splicer that was causing an issue with th Java program. Once the screen splicer

Java 6, JFrame stuck alwaysontop

做~自己de王妃 提交于 2019-12-23 04:02:32
问题 This issue only seems to occur since I upgraded from 1.5 to 1.6 The main JFrame, randomly seems to get stuck infront of every other application in windows. Even another JDialog popping up set to alwaysontop(true) will be behind this main JFrame. Any ideas on what could be causing this issue? / Any ideas for solutions? Never had this issue before on Java 5. 回答1: Sorry guys it seems it was a program used as a screen splicer that was causing an issue with th Java program. Once the screen splicer

Using dom4j DOMDocument to feed validator.validate(DOMSource) fails in java 1.6 (xsi:noNamespaceSchemaLocation is not allowed), works in 1.5

眉间皱痕 提交于 2019-12-22 08:08:16
问题 Using dom4j DOMDocument to feed validator.validate(DOMSource) fails in java 1.6 (with xsi:noNamespaceSchemaLocation is not allowed to appear in root element), works in 1.5 I'm finding the following problem quite intractable (OK, that's an understatement) - any insights will be appreciated. Currently it seems like the best idea is to drop dom4j in favour of e.g. XOM (http://stackoverflow.com/questions/831865/what-java-xml-library-do-you-recommend-to-replace-dom4j). I've been validating in

What does Java compile an enumeration down to?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 04:24:07
问题 A coworker and I had a discussion about how Java represents enumerations. I was under the impression they were strictly ints like C/C++. Or, if you add behavior (Type-Safe enum), it gets wrapped in a class. He believed that if it's small enough Java would compact it to a byte. However, I found this on the Oracle site: Java programming language enums are far more powerful than their counterparts in other languages, which are little more than glorified integers. The new enum declaration defines

What is the difference between the Java 1.6 and 1.7 jarsigner

空扰寡人 提交于 2019-12-20 12:28:18
问题 Just noted that you can´t sign Android APKs with the Java 1.7 jarsigner. So I wonder why this is and what is the difference between the 1.6 and 1.7 signer? 回答1: This is because the default digest algorithm for Java 1.7 is SHA-256 while for Java 1.6 it's SHA1withDSA . Java 1.6 Jarsigner docs Java 1.7 Jarsigner docs 回答2: Yes you CAN use 1.7! It is very tricky to find info on the usage with 1.7, but once found it is reasonable simple: For keytool include -sigalg SHA1withDSA -keyalg DSA -keysize

Get java.nio.file.Path object from java.io.File

青春壹個敷衍的年華 提交于 2019-12-20 08:56:06
问题 Is it possible to get a Path object from a java.io.File ? I know you can convert a path to a file using toFile() method, but I couldn't find the opposite conversion. Is there a way to do this in Java 6 or lower? 回答1: Yes, you can get it from the File object by using File.toPath(). Keep in mind that this is only for Java 7+. Java versions 6 and below do not have it. 回答2: From the documentation: Paths associated with the default provider are generally interoperable with the java.io.File class.

java 6 IO - wrapped streams closing [closed]

不羁岁月 提交于 2019-12-20 07:48:40
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Consider : public static void read(String filename) throws IOException { String charsetName = "UTF-8"; InputStream file = new

Java - Removing the double quotes in XML attributes

陌路散爱 提交于 2019-12-20 07:20:38
问题 I have an xml string which I get via a REST call. However, some of the attributes have corrupted values. For example: <property name="foo" value="Some corrupted String because of "something" like that"/> How can I replace double-quotes either not preceded by value= or not follown by /> with a single quote and get a valid XML string out of that corrupted one in Java 6? EDIT: I have tried to modify this lookahead/lookbehind regex that was used for VisualBasic. But because of the incompatibility

Java - Removing the double quotes in XML attributes

爷,独闯天下 提交于 2019-12-20 07:20:29
问题 I have an xml string which I get via a REST call. However, some of the attributes have corrupted values. For example: <property name="foo" value="Some corrupted String because of "something" like that"/> How can I replace double-quotes either not preceded by value= or not follown by /> with a single quote and get a valid XML string out of that corrupted one in Java 6? EDIT: I have tried to modify this lookahead/lookbehind regex that was used for VisualBasic. But because of the incompatibility