jdk

Java Compiler gives a strange Error.

Hi All, I’m working on a Java project and I can compile my project inside eclipse (with JDK 1.6.0_14) without any issue. But when I’m compiling the project inside my build system I’m getting following strange error. Exception in thread "main" java.lang.VerifyError: (class: javax/xml/marshal/StreamScanner, method: fail signature: (ILjava...

Does primitive wrapper instantiation cause memory allocation in JDK 1.6

From PMD: IntegerInstantiation: In JDK 1.5, calling new Integer() causes memory allocation. Integer.valueOf() is more memory friendly. ByteInstantiation: In JDK 1.5, calling new Byte() causes memory allocation. Byte.valueOf() is more memory friendly. ShortInstantiation: In JDK 1.5, calling new Short() causes memory allocati...

Most interesting/useful Java classes?

I've been using Java for a year or so now, and I constantly find myself discovering new things in the language. Most of this cool stuff, interestingly enough, doesn't come from 3rd-party APIs or libraries, but rather from the classes that ship in the JDK. So I'm wondering, partly out of curiosity and partly for the education of others a...

Installing Java JDK on Ubuntu 10.04

Ever since I upgraded my Ubuntu from 9.10 to 10.04 I can't start Netbeans any more, because apparently they are dropping support for Java's JDK in favor of OpenJDK. Well, problem is, my IDEs won't work with OpenJDK. apt-get install sun-java6-jdk is not working. I downloaded the Linux installation file from Sun (jdk-6u21-linux-i586.bin) ...

Java compiler in Ubuntu

I've set up Eclipse in Ubuntu 10.04. I currently have the OpenJDK JRE installed but don't have the JDK needed to compile. However, the code written Eclipse still compiles. Is this a standard compiler included in Eclipse? I've searched through the package manager and don't seem to have any of the JDKs installed... Note: running 'javac' ...

How to compile jdk itself

Hi all, I want to compile jdk itself. I mean, I want to modify String.class in jdk to see created string objects in the system. Is there any way to modify classes in the jdk? When I try to modify source by modifying rt.jar, I got the error. java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:394) at ...

NetBeans- Java Fx(mobile) could'n buld the projecjt..

I have an error in NetBeans(mobile business application) I have installed JDK (latest version jdk1.6.0_21) After this I had an error: Cannot run program "C:\Program Files (x86)\Java\jre6\bin\javac.exe": CreateProcess error=2, The system cannot find the file specified BUILD FAILED (total time: 1 second) Then in "Advanced system setting...

End of life of IBM JDK/JRE 5?

Is there an announced end of life/end of support-date for the ibm jdk 5 (on Solaris/SPARC and Linux/x64)? ...

why java.util.HashMap.getEntry can block my program ?

Hi, everyone, my program had been blocked , I used the jstack commander to analyze, the following thread took the lock "0x0000000603f02ae0" , and others threads couldn't fetch the lock. I had waited at least one hour, but the thread didn't unlock , my question is why the thread'state is RUNNING, and stop at java.util.HashMap.getEntry(Has...

HttpURLConnection implementation question

I have read that HttpURLConnection supports persistent connections, so that a connection can be reused for multiple requests. I tried it and the only way to send a second POST was by calling openConnection for a second time. Otherwise I got a IllegalStateException("Already connected"); I used the following: try{ URL url = new URL("http:...

configuring m2eclipse: "Eclipse is running in a JRE but a JDK is required"

After installed m2eclipse, I received a message saying that Eclipse needs to "run in a JDK" and to update the eclipse.ini to do so. So I added this: -vm C:\Program Files (x86)\Java\jdk1.6.0_20 as the last two lines of the eclipse.ini file in my Eclipse installation directory. However, I am again receiving this warning. Did I not en...

JNI, dll and windows 7 x64

Hi, i write some dll in windows xp sp3 x86 using Visual Studio 2008. Dll is calling in java throught jni. In windows xp x86 sp3 everything is working fine. I try to use this dll in windows 7 x64 and my virtual machine is crashed. I try few combination: 1) jdk1.7 x64, Eclipse x64, dll x64 2) jdk1.7_12 x86, Eclipse x86, dll x86 and ev...

Looking for help with 2 errors when compiling the application.

Good evening everyone! I am working on learning some java and I have made it to the notepad tutorial and when I go to run it on the emulator, I am getting a few errors, and I'm hoping someone here may be able to help. package com.a8a.todolist; import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import a...

Android - Looking for help with force close on application.

I am using Eclipse to write the program. I have gotten rid of the errors, and have completely compiled the code and when it launches in the emulator, it forces close. I have zipped the workspace so maybe someone can grab it and load it to see if they are able to see why its bombing out? deckertdesigns.com/Android/Todo_List.zip any help ...

Is it possible to install eclipse without jdk in linux

I want to install eclipse in linux, Is it possible to install eclipse without jdk in linux. How to install eclipse in linux. Im using Federo 10. Please give the suggession. ...

How to execute the JAXB compiler from ANT

Hi, I am using JAXB on a project. the attraction of JAXB is that it is bundled with the JDK, I have been to use xjc.exe on the command line to generate the .java files from a schema. I can't seem to find the JAXB ant task, sure there is a download at https://jaxb.dev.java.net however i want to use the JAXB that is bundled into the JDK i...

Does Mac need JDK (5 or 6) or Eclipse for developing Android Apps?

I want to develop Android apps on the Mac, but the information on http://developer.android.com/sdk/index.html is confusing. Apart from the android-sdk_r06-mac_86.zip , does the Mac need JDK or Eclipse ? The JDK installation page gives a link to Apple site for downloading "Java Developer Preview 10M3222+9M3222", which is a pre-release ve...

Examples of Design Patterns used in JDK

Possible Duplicate: Examples of GoF Design Patterns At an interview a while back I was asked for some examples of Design Patterns within the JDK. Off the top of my head I was able to identify Flyweight - as used in the String pool Singleton - in java.lang.Runtime Iterator - as used on Collections classes Not that many. Wh...

In Maven: how to attach sources to tools.jar

I have to use libraries in tools.jar and have therefor added this dependency: <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6.0</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> Now I would like to attach the sources in Eclipse, ...

Why should I use the 64-bit JDK over the 32-bit version?

I use Eclipse and 64-bit Windows and develop Java desktop applications. Sofar I have only used the 32-bit JDK, is there any reason to change to 64-bit JDK for Java development? ...