Tagged Questions
0
votes
0answers
9 views
jOOX: unmarshalling does not work under JDK7
I want to parse and unmarshall a Wordpress export using jOOX.
Here's my code:
URL myUrl = new ...
0
votes
1answer
44 views
JDK 1.7 String switch statement is not working
[Fixed]
Thanks to @Visil below (accepted answer). I added the recommended code to build.gradle and waited after syncing gradle. The following popped up shortly after that...
Original Question
I ...
2
votes
1answer
121 views
Conc Mark and Sweep Garbage Collector difference between java 1.6 and 1.7
I was using jdk 1.6 with CMS GC and when I tried to migrate to JDK 1.7, the heap usage increases and the process becomes slow.
Is there a major difference in GC behavior in these versions? What is ...
2
votes
2answers
4k views
best example for programmatically creating SplashScreen with text
I need to create a SplashScreen programmatically and add text to it (and change it).
Most examples work with thecommand line parameters.
Are there solutions working without?
0
votes
1answer
277 views
Dynamically scale SVG image to the frame/window size
I am using SVGSalamander.
My code loads a svg image and sets it as background of a JDesktopPane.
File f = new File("awesome_tiger.svg");
SVGUniverse svgUniverse = new SVGUniverse();
try {
...
0
votes
1answer
37 views
code after H2 statement is not executed
The code after the statement is not executed, but why? Does the statement do a return?
conn.createStatement().execute("CREATE TABLE IF NOT EXISTS WEBSITES(ID INT auto_increment, NAME VARCHAR)");
...
0
votes
2answers
782 views
Java: Upload file from url directly to ftp server with a library
It is possible to transfer a file from a url (http://... .exe/ .zip ...) directly to a ftp server in Java 7 (with some additional libraries eg from Apache?
0
votes
1answer
25 views
Android doesn't support Java v7+, so should I use multiple catches or one catch with instanceof checks?
I've got the following situation:
try{
// Do some things that can cause the exceptions
}
catch(SomeException ex){
doSomething();
}
catch(SomeOtherException ex){
doSomething();
}
...
4
votes
2answers
318 views
How to get International Atomic Time in Java 7
I am working on a Java7 project, and we need a timestamp in International Atomic Time. I've found a few other questions relating to this that point to JSR-310 and ThreeTen Project (which is ...
0
votes
1answer
33 views
How to check revision history of java source code
I want to check the revision history of JAVA's
java.util.logging.LogManager
for this method
demandLogger
I can see here the difference between java 7 versions but in which exact version ...
1
vote
1answer
36 views
Upgrade struts web Project to java 1.7
We are planning upgrading our web project to java 1.7 from 1.6.
We are using Struts 2.0.9 and iText library 2.1.4.
I want to make sure that are this(struts & itext) API compatible with JDk 7.
I ...
0
votes
3answers
632 views
How to install java 7 on mac in custom location?
I want to install java 7 on mac silently. I am unable to find any documentation/links on the same. Also I don't want it in /Library. Is it possible to install the same on any custom location. I am ...
0
votes
1answer
13 views
Bootstrap classpath not set
I just upgraded my java to 1.7.0_60. I'm using maven to build my components. When I try to run mvn test on a component, I get this error message-
[INFO] Compilation failure
could not parse error ...
0
votes
0answers
39 views
+100
Launching SWT on Mac using Java Web Start
Goal: Launch SWT Web Start application on Mac using Java 7
In order to run an SWT RCP application on Mac OS X, it is well documented that it is necessary to include -XstartOnFirstThread as part of ...
17
votes
2answers
24k views
maven / doesn't use java 7
I want to package a maven-(multi)module, the parent pom includes:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
...
0
votes
1answer
24 views
I want to install Java through the command line but I don't have sudo access.
This is what I have already done:
prompt> wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" ...
5
votes
4answers
3k views
How to silently install Java JDK into a specific directory on windows
On my development machine I always have to install Java 6 and Java 7 and I have to install each JDK in both, the 32 and 64 bit version, for testing purposes. Since the frequency of Java updates seems ...
0
votes
0answers
27 views
Eclipse Jdk issue while building the project
I have been working in eclipse project environment from 6 month. but due to change in the jdk version as per project requirement, i shifted from the jdk 1.6 to jdk 1.7.0_25. now i am getting an issue ...
2
votes
1answer
2k views
Java 7 WatchService - The process cannot access the file because it is being used by another process
I followed the Watching a Directory for Changes Java7 nio2 tutorial to recursively monitor the entire contents of a directory using the code sample WatchDir.java.
The code looks like this:
// Get ...
0
votes
1answer
24 views
WebLogic 12c - Destination unreachable exception
First, I had installed jdk 1.6.0_43 and oracle weblogic 12.1.1, I was successfully able to deploy my application.
I then upgraded both my jdk (1.7.0_60) and weblogic (12.1.2), but was unable to ...
33
votes
5answers
17k views
New features in java 7
Possible Duplicate:
What differences will Java 7 have from Java 6, and what will it mean to us Java programmers?
What new features in java 7 is going to be implemented?
And what are they ...
1
vote
3answers
583 views
Eclipse ADT 22.6.2 still gives the error “java.lang.NullPointerException”
This issue is supposed to be fixed by the latest ADT release(22.6.2), but I'm still receiving the same error when I'm trying to create an empty Android Application Project.
Here is the exact error:
...
1
vote
1answer
35 views
Handling org.xml.sax.SAXParseException while reading and writing an XML file using JAXB
I'm creating an XML file using JAXB as follows.
public final class Main
{
private File file;
private transient JAXBContext jaxb;
List<Fruit>fruits;
private void test()
{
...
0
votes
1answer
25 views
Real-life usage of Path.relativize() if source path contains anything else than real folders
While preparing a java 7 certification exam, I had to start looking closely at the Path.relativize() method. While superficially its purpose seems straight forward, express a path relatively to ...
0
votes
1answer
27 views
Java maven build failure with source 1.7 (or 7)
I am upgrading my java 6 code to java 7. Have updated JAVA_HOME to point to JDK 1.7 on OS X 10.9. The code is not using any Java 7 features yet.
When I run the build "mvn clean install" the build ...
2
votes
5answers
665 views
Will structs and value types (like C#'s) be included in Java 7?
Will structs and value types (like C#'s) be included in Java 7?
-3
votes
1answer
42 views
Is source code of JDK available and from which vendors [closed]
Is source code of JDK available?
Are there multiple vendors which provide the JDK binaries? Like IBM JDK, Oracle JDK and so on. If so, i have seen that some products mentioning to prefer a particular ...
117
votes
12answers
53k views
Installed Java 7 on Mac OS X but Terminal is still using version 6
I've installed JDK 7u7 downloaded from oracle's website. But after installation, the terminal is still showing java version 6
$java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment ...
1
vote
2answers
37 views
MethodHandle and thread safety
Is it safe to cache and re use the instances of java.lang.invoke.MethodHandle?
I check the JavaDoc and couldnt find anything about thread safety.
1
vote
1answer
369 views
Universal CSS Engine recommended for Swing applications or alternative library
It seems the Universal CSS Engine is quite old and not actively developed (the last code change was over a year ago and just 25 code changes / commits in total).
Has someone experiences with it and ...
0
votes
2answers
109 views
x in y is defined in an inaccessible class or interface, ID in structure
I am getting main.java: error: someId in someStruct is defined in an inaccessible class or interface but how can I solve this?
my main class:
import subdir.Subclass;
public class main{
...
...
0
votes
1answer
110 views
Java: Create PDF pages from images using PDFBox library
I need to convert images (mainly JPEG) directly to PDF pages for a PDF document.
It may be that the images differ in size.
Each PDF page should have the exact dimensions as the images.
So each page ...
0
votes
0answers
24 views
Java Spark: Wildcard in the middle of a URI
I am trying to make a REST API with a call through an arbitrary number of containers using the Spark framework in Java. For example,
/foo/bar/:id1/bar/:id2/end
...
1
vote
3answers
17k views
How to modify Java Control Panel selections (corresponding to deployment.properties file) from windows command prompt?
How to modify Java Control Panel selections (corresponding to deployment.properties file) from windows command prompt?
Specifically, I am looking for command(s) which can effect change in "Action for ...
1
vote
2answers
107 views
Mac OS-X Eclipse with Google App Engine setup: JDK version error when launching Eclipse
On my Mac OS-X Mavericks, I had the Eclipse Java Enterprise Ed Helios version with JRE 1.6 installed.
I updated my Eclipse version to Eclipse Kepler Java Enterprise Edition (Eclipse Kelpler v 4.3)
...
75
votes
10answers
100k views
How do I use JDK 7 on Mac OSX?
OK. This is a newbie question but I can't figure it out...
I would like to use the WatchService API as mentioned in this link:
...
1
vote
3answers
69 views
The method replace(String, ArrayList<>) is undefined for the type HashMap
I have a code that works okay on my machine:
ArrayList<Posting> postings = invertedLists.get(key);
//---- Apply some changes on postings -----
invertedLists.replace(key, postings);
When ...
-2
votes
2answers
65 views
Self-executing Java methods
In JavaScript, it is possible to write a self-executing function like this:
(function foo() {
console.log("bar");
}());
I'm looking to do this in Java. So for example:
// This code does not ...
22
votes
2answers
355 views
Java ternary operator influence on generics type inference
public List<String> foo1() {
List<String> retval = bar();
if (retval == null)
return Collections.emptyList();
else
return retval;
}
public List<String> ...
4
votes
3answers
109 views
JSR-356: How to abort a websocket connection during the handshake?
I need to be able to abort a websocket connection during the handshake in case the HTTP request does not meet certain criteria. From what I understand, the proper place to do that is inside the ...
1
vote
4answers
255 views
Invoke private method with java.lang.invoke.MethodHandle
How can I invoke private method using method handles ?
As far as I can see there are only two kinds of publicly accessible Lookup instances:
MethodHandles.lookup()
MethodHandles.publicLookup()
...
92
votes
2answers
4k views
Differences in auto-unboxing between Java 6 vs Java 7
Hi I have noted a difference in auto unboxing behavior between Java SE 6 and Java SE 7. I'm wondering why that is, because I can't find any documentation of changes in this behavior between these two ...
0
votes
1answer
18 views
setInitialFileName is not working in jdk 1.7.0 update 25
setInitialFileName is not working in jdk 1.7.0 update 25 but it is working in other versions like 1.7.0 update 45 and update 55. Someone please help me with some common method to set the file name ...
1
vote
2answers
40 views
JAXB mixed versions? undefined 'required' attribute
Im generating some classes from WSDL files with wsimport maven plugin @ Mule Anypoint Studio 3.5 with JDK 1.7_55
I'm using jaxb 2.2.7 and remove version 2.1.9 from mule libs and replaced by 2.2.7.
...
1
vote
1answer
457 views
Self-signed (jdk 7u45) Applet got NullPointerException when runs on SSL in firefox and chrome
I am using an applet in my web application.
I create self-signed applet jar file and compile classes using Oracle JDK 1.7.45.
In client side, I use JRE 1.7.51 and import the certificate.
The applet ...
12
votes
2answers
4k views
Play Framework - can not reserve enough space for object heap
I made some modifications to my play project and when I try and run it I get errors.
>play run
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: ...
2
votes
2answers
38k views
Java applet won't run under JRE7, no error displayed in console
Under Windows 7, 64-bit, since upgrading to JRE-7 32-bit, under IE9 32-bit or Chrome, I can't run applets such as this one. Inside the Applet rectangle, I see the message "Error. Click for details"
...
2
votes
2answers
53 views
Java 7 Checked exception rules
I know the rules about checked exceptions, but I can't quite work out this puzzler. Why does thfe second method not compile, but the first one does? The error is "Unhandled exception type Exception" ...
-1
votes
1answer
41 views
Can't prevent text from being entered in JTextArea (in JScrollPane)
As per the question above.
I have a JTextArea in a JScrollPane and it will keep on letting me add text forever (and simply not let me display it or scroll to it, due to constraints on the visible ...
1
vote
1answer
2k views
Java 7: Fork/Join Example - Did I get this right?
I am getting my hands dirty with Java 7 concurrency and parallelism feature - Fork/Join Framework.
I am trying to display the list of all directories under a given path. Can some one tell me if I got ...