java

Linking an external .jar from an Xcode java project?

How do I link an external .jar into my Xcode java project? That is, have it in the classpath during compilation and execution. I'm using Xcode 3.0 and this seems to have changed since 2.4. ...

is there a "best practice" to access another process in the OS through java?

Hi, I've been reading Skype4Java (java api for skype) and noticed they use jni to access the skype client. intuitively I'd assume that there already is a standard library in java that has an OS-sensitive jni implementation to access other processes. I set up to look for one, but couldn't find it. Is there such a library? if not, is t...

How do you get the Class of an Abstract class (Object) in JavaME

So i need to get the Class of an object at runtime, and sorry guys Javas not my home ;0) For an none abstract class i could do something like: public class MyNoneAbstract{ public static Class MYNONEABSTRACT_CLASS = new MyNoneAbstract().getClass(); But for an abstract class this does NOT work (always gives me Object) public abstr...

Methods in a Java interface with or without public access modifier

Should methods in a Java interface be declared with or without a public access modifier? Technically it doesn't matter of course. A class method that implements an interface is always public. But what is a better convention? Java itself is not consequent in this. See for instance Collection vs. Comparable or Future vs. ScriptEngine. ...

Truncating Method calls

This is a subjective question as I want to gauge if it's worth me moaning at my co-workers for doing something which I find utterly detestable. The issue is that a bunch of my co-workers will truncate method calls to fit a width. We all use widescreen laptops that can handle large resolutions (mine is 1920x1200) and when it comes to deb...

Using Quotes within getRuntime().exec

Hi, I'd like to invoke bash using a string as input. Something like: sh -l -c "./foo" I'd like to do this from Java. Unfortunately, when I try to invoke the command using getRuntime().exec, I get the following error: foo": -c: line 0: unexpected EOF while looking for matching `"' foo": -c: line 1: syntax error: unexp...

could not read column value from result set ; String index out of range: 0

Hello ! I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query. The thing is, the table contains a colum that is mapped to a char in Hibernate Model, and sometimes this column is empty. And I suppose this is where my exception comes from. How can I map a colum of char to my hibernate model without getting this err...

How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant

We have the usual web.xml for our web application which includes some jsp and jsp tag files. I want to switch to using pre-compiled jsp's. I have the pre-compilation happening in the build ok, and it generates the web.xml fragment and now I want to merge the fragment into the main web.xml. Is there an include type directive for web.xm...

What does the "static" modifier after "import" mean?

like this: import static com.showboy.Myclass; public class Anotherclass{} And what's the difference between "import static com.showboy.Myclass" and "import com.showboy.Myclass"? ...

Dataflow Programming API for Java?

I am looking for a Dataflow / Concurrent Programming API for Java. I know there's DataRush, but it's not free. What I'm interested in specifically is multicore data processing, and not distributed, which rules out MapReduce or Hadoop. Any thoughts? Thanks, Rollo ...

Java development for the web

I'm looking to start developing for the web using Java - I have some basic Java knowledge, so that's not a problem, but I'm at a loss when it comes to deciphering the various technologies for use in web applications. What options are available to me? How do they work? Are there any frameworks similar to Django/Ruby on Rails which I coul...

What is the role of Spring in Struts + Spring + Hibernate?

What role is Spring taking in Struts + Spring + Hibernate? ...

Spring MVC Form tags: Is there a standard way to add "No selection" item?

There is a select dropdown and I want to add "No selection" item to the list wich should give me 'null' when submitted. I'm using SimpleFormController derived controller. protected Map referenceData(HttpServletRequest httpServletRequest, Object o, Errors errors) throws Exception { Map<String, Object> map = new HashMap<String, Object...

How to find unused/dead code in java projects

What tools do you use to find unused/dead code in large java projects? Our product has been in development for some years, and it is getting very hard to manually detect code that is no longer in use. We do however try to delete as much unused code as possible. Suggestions for general strategies/techniques (other than specific tools) ar...

Utilizing Java API from a Cobol program

We have some COBOL programs running on our mainframe and we need one of those to communicate with our back end vault through a Java API. Is there any way a Cobol program can invoke the Java program? Would it be possible to use a Web Service from Cobol? How would I integrate a Cobol program with anything else? ...

How do I get the row count in JDBC?

I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance? I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers. ...

C, C++, Java, what is next and what will it look like?

What do you think the next evolution of languages will look like? ...

Why do Jars get Excluded from Enunciate's Deployment?

I'm using Enunciate to build a prototype REST api and need to include a jar containing custom code as a library. My Ant Script looks like this: <!--include all jars--> <path id="en.classpath"> <fileset dir="${lib}"> <include name="**/*.jar" /> </fileset> </path> <!--define the task--> <taskdef name="enunciate" classn...

How do I call Java code from JavaScript code in Wicket?

If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket. ...

SWT Link flickers with gradient background

I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, however, is overkill for my needs, and I couldn't properly customize the look of ...