java

How can I highlight java code via CSS?

I saw some cool code highlighting that looked like code in Eclipse, however I can't find it. :( Do you know any cool java code highlight css? ...

NoClassDefFoundError on JFace FontRegistry

When I launch an SWT application (via an Eclipse launch profile), I receive the following stack trace: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jface/resource/FontRegistry at org.eclipse.jface.resource.JFaceResources.getFontRegistry(JFaceResources.java:338) at org.eclipse.jface.window.Window.close(W...

Confusion over class resolution in Oracle java stored procedures

I'm trying to use a third-party java library within oracle. The library seems compatible with the same 1.4 version of the jvm that our Oracle 10g server hosts, since it runs fine outside of Oracle, so I feel like I should be able to get this to work. This library ends up making SOAP-based http requests, and I get class resolution error...

Executable Jars running very slowly

I've done several projects and packaged them into jar files, but I've noticed that my jar files run much more slowly than in my IDE. I use Eclipse to compile and run my programs. In Eclipse, I have everything working. When I package my project as a runnable Jar and execute it by double-clicking, everything still works. But when I have a...

Why Jython behaves inconsistently when tested with PyStone?

I've been playing recently with Jython and decided to do some quick and dirty benchmarking with pystone. In order to have a reference, I first tested cPython 2.6, with an increasing numbers of loops (I thought this may be relevant as Jython should start to profit from the JIT only after some time). (richard garibaldi):/usr/local/src/pyb...

How do I use Apache POI to read a .DOC file in Java to separate images from text?

I need to read a Word .doc file from Java that has text and images. I need to recognize the images & text and separate them into 2 files. I've recently heard about "Apache POI." How I can use Apache POI to read Word .doc files? ...

Do you know good tutorial websites to develop a prePost in Tomcat?

We want to integrate a prepost rutine in our webserver (tomcat). A filter that will capture the post before sent to the user and add a line of code in the html before sent to the user. We are looking for tutorial or any help on this. ...

Music transcription

Hi, I'm working on a polyphonic music transcription project. I have read some papers and gone through articles which explains similar tasks. I'am very confused about many aspects of the problem domain. Hope someone will be able to help me. So far I have obtained a stream of decoded audio data from a given mp3. I have understood onse...

How to open a command terminal in Linux?

Hi, I want to open the terminal (command prompt) on a Linux machine using Java code. I know how to open command prompt in windows.The following code i have used in windows String command= "cmd c/start cmd.exe" Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(command); I need the same thing in Linux. Thanks for your answers. I ...

Java (J2ME) Convert Image to byte[], then back to Image

Hey, I'm trying to convert an Image object to a byte array then back to an Image (so that I can store the image in a blob object in an Apache Derby Database). I can convert an Image to a byte array (code below) but I cann't convert the bytes back to an image. As a further complication I'm using J2ME, so I can't use javax.image.*. Can y...

Would you recommend the Java Puzzlers book for a beginner?

Hi, I am pretty much a beginner java programmer. do you think the book Java Puzzlers is a good read for learning and inspiration?. Any other books you recommend for java beginners would be great. ...

Java AudioSystem and TargetDataLine

I am trying to capture audio from the line-in from my PC, to do this I am using AudioSystem class. There is one of two choices with the static AudioSystem.write method: Write to a file Or Write to a stream. I can get it to write to a file just fine, but whenever I try to write to a stream I get thrown java.io.IOException (stream length n...

streaming desktop to flash player

hi I would like to stream my desktop screen (or one of the application which i select) to flash player i woul like to publish my desktop in web i have wowze media player to multicast it but i have to create stream and give it to the wowze do you have any idea how to start what would be the best for it can you recomend something? ...

With a DAO pattern, do you ever expose the EntityManager or Session as a parameter?

Is there ever a case in a standard webapp where one would pass an EntityManager or Session as a parameter to a DAO call, i.e. findPersonByName(String name, Session session)? Or should the the opening and closing of the session be abstracted in the implementation? ...

Java List with blank allowed

Hello, This is probably really simple but I really could not word it properly on Google. See, I have a ArrayList that keeps the info for each thread. Each thread has it's own ID. So, at the beggining: myList.add(theIdOfTheThread, new InfoForTheThread()); //Add new thread info at index theIdOfTheThread And when I want info: myList.get...

Best way to convert an ArrayList to a string

I have an ArrayList that I want to output completely as a String. Essentially I want to output it in order using the toString of each element separated by tabs. Is there any fast way to do this? You could loop through it (or remove each element) and concat it to a String but I think this will be very slow. ...

JavaMail Question or Bug?

I have a question about Java Mail and how it works with streams. In Java Mail 1.4.1 there is a MimeMessage constructor that accepts a stream. My understanding is that I could pass a stream to this constructor and it would parse it for me into a MimeMessage. I wrote 2 tests to prove this. The first test sends in a stream that contains...

Write a firefox plugin and access it from a java application

Hi, I want to write a firefox plugin which will communicate with a java application. The plugin will have to notify the java application of the web page/ url being loaded. The java application will take care of the rest. Any help or pointers will be much appreciated. Regards, New to firefox ...

collection of system properties using web browser

hi i am doing distributed computing environment........For the applications need to get distributed to different clients connected to the server in the network,i prefered to collect the client's system properties like free memory available in the client's system,so that i could distribute d application according to that efficiently.........

java.sql.SQLException: Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.

Encountering this error with our J2EE application. How to know how much connection the application is currently using and what should be the optimal connection pool settings for a heavily traffic applicaiton ...