java

Methodology for upgrading OS Kernel

I am looking to get into operating system kernel development and figured my contribution would be to extend the SANOS operating system in order to support JDK 1.6 and 1.7. I have been reading books on operating systems (Tannenbaum) as well as studying how BSD and Linux have tackled this challenge but still am stuck on several concepts. ...

unEscape JavaScript escaped value in JAVA

in our web service we set a cookie through JavaScript wich we read again in Java (Servlet) however we need to escape the value of the cookie because it may contain illegal characters such as '&' which messes up the cookie. is there a transparent way to escape (JavaScript) and unescape again (JAVA) for this? thanks, Pieter Goddijn ...

Weird Clojure Box - library (dll) issue

I am trying to use the JACOB library with Clojure using Clojure Box. I have added this to my .emacs: (setq swank-clojure-library-paths (list "c:/dev/dlls")) C:/dev/dlls/ contains the jacob-1.14.3-x86.dll. I have added a .clojure dir to my ~/ dir and that contains the jacob.jar. At the Clojure Box REPL, (System/getProperty "java.cl...

how to compare 2 ms word document with org.eclipse.compare api and java.

hi I want to compare 2 ms word document, after searching lot I found 2 ways we can do this. 1) compare with docx4j api. 2) compare with org.eclipse.compare api. with docx4j we can compare only 2 paragraph and it will works only with .docx extention. so I feel like if we can compare docs with eclips compare api than it will be better...

Merging Multiple Jars in to a Single Jar

my application needs multiple jars to work. Since it is a desktop application i can not hold the user responsible of installing. So in my build script i unzip the jars content in to my build directory delete manifest files, compile my software and jar it again. Everything works as it should my question is are there any long term side eff...

Swing: How to read graphic information underneath a component?

Hello! How could I "read" graphic information underneath a component (let's say as BufferedImage)? I want to make that component half-translucent (already done) and apply graphic effects on underlying stuff, such as blur all elements under that component (but not the component itself). My approach is probable wrong: I try to get gra...

Hibernate "PreInsertEvent.getSource()" NoSuchMethodError.

Hi I'm recieving the following error when trying to do inserts: java.lang.NoSuchMethodError : org.hibernate.event.PreInsertEvent.getSource()Lorg/hibernate/event/EventSource; I've seen other people with the same problem due to incompatibility in hibernate jars, but I believe I've got it right (according to the compatibility matrix)...

Java - getting jar dependencies right

Hi I'm relatively new to Java & maven, and so to get to know my way around, I decided to do a project as a means for learning. I picked a pretty common stack : Java 1.6 Hibernate (with annotations) Spring (with annotations) JUnit 4 Tomcat Oracle XE / In-mem hsqldb By far one of the biggest problems I've experienced is getting the ...

String to Date in Different Format in Java

Hi, I want to convert String to Date in different Format. For example, I am getting from user, String fromDate = "19/05/2009"; (dd/MM/yyyy) I want to convert this fromDate as a Date object of "yyyy-MM-dd" format How can I do this? Thanks in Advance ...

How to pass Java textfield to an array list?

Guys, kindly help me how to pass the values of my inputs in my JTextField(ID,LastName,FirstName,Course,Year) into my ArrayList without replacing the existing elements. At the same i'll be using my ArrayList stored values to append in my JTextArea(summary) ////// PALOS TEXTFIELD List<Form> myList = new ArrayList<Form>(); id = new...

Debugging a java program on a client machine?

I've been asked to help figure out why a java application doesn't run as intended. Edit: Thanks to everyone that answered, but it turned out that the problem was an altogether different one. In fact, it has nothing to do with java, even though the program is written in java. I've posted another question on ServerFault here if anyone's ...

Integrating grails into an existing spring application?

What if you don't want to start a separate project for grails but instead sneak it into an existing webapp? I have to build an admin interface/crud for some new entities and thought it would be a perfect way to learn grails. ...

How to enable events on components in JList

I'm using custom renderer on JList, but none of components rendered are accessible. list.setCellRenderer(new ListCellRenderer() { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JCheckBox c = new JCheckBox(); JButton b = new...

Capturing stdout when calling Runtime.exec

When experiencing networking problems on client machines, I'd like to be able to run a few command lines and email the results of them to myself. I've found Runtime.exec will allow me to execute arbitrary commands, but Collecting the results in a String is more interesting. I realize I could redirect output to a file, and then read fro...

How to delete Hudson workspace before build?

I want to have a way to teach hudson to delete the complete workspace before doing a checkout & build. Is there a plugin which enables that? ...

how to change the name of a Java application process?

when executing a Java application the process name given to it is usually java.exe or javaw.exe. But how can I make it be called by the name of my application? ...

What is the difference between iterators in Java and C++?

How is the implementation of Iterator in Java different from that in C++? ...

UDP client and server

Hi I want to use UDP client which using Microphone to record the voice and send wave file direct to UDP server. If anyone has java code plz help me. Thank you. ...

correctly printstacktrace of servlet exception

so i am using a filter to catch servlet exception (because we are using a mix of jsf/plain servlets) when catching the ServletException and calling printstacktrace most of the information is lost. the "true" root exception seems to be hidden behind the "funny" expression ((ServletException) e.getRootCause().getCause()).getRootCause()...

How can I determine if a date is between two dates in Java?

How can I check if date is between two dates in java (Not through a MySQL query)? ...