java

Is it possible to package all the jar dependencies in one big jar ?

I know this isn't "best practice", but can I include all of the dependencies in one big jar? ...

How Do You Prevent A javax Transformer From Escaping Whitespace?

I'm using the javax.xml.transform.Transformer class to perform some XSLT translations, like so: TransformerFactory factory = TransformerFactory.newInstance(); StreamSource source = new StreamSource(TRANSFORMER_PATH); Transformer transformer = factory.newTransformer(source); StringWriter extractionWriter = new StringWriter(); String xml ...

How to completely remove Java? (Error: could not open `C:\Program Files\Java\jre6\lib\i386\jvm.cfg')

I have passed the last couple of hours trying to downgrade Java to 1.6.0_13 in my attempt to get Google Web Toolkit's hosted mode to work on Eclipse. And it has proven to be a nightmare-ish task! In retrospect: - All references to Java in the Control Panel -> Uninstall a Program tool have been removed - Those that didn't want to be rem...

DBUnit: Did not find column 'MYCOL' for <schema.table> 'MYSCHEMA .MYTABLE' in catalog 'MYDB' because names do not exactly match.

I am having trouble creating an export of my database using an org.dbunit.database.QueryDataSet. When I call org.dbunit.dataset.xml.FlatXmlDataSet.write(IDataSet, OutputStream), I get the following stack trace: java.lang.IllegalStateException: Did not find column 'MYCOL' for <schema.table> 'MYSCHEMA .MYTABLE' in catalog 'MYDB' because...

java.lang.InternalError: Location with invalid code index... What?

I am creating a j2me application, and when I try to debug it in netbeans, I get an error when I reach a point in my code. The code is as follows class MyClass{ public MyClass() { OtherClass oc = new OtherClass(); oc.MyMethod(); } } The other method is as follows: public void MyMethod() { boolean isVal...

Search Entire Computer for a File Name in Java

Is there a way to search an entire computer for a String value representing a file name in Java? This would be without knowing the names of the drives on the computer. ...

Best way to remove repeats in a collection in Java?

Hey all, This is a two-part question: First, I am interested to know what the best way to remove repeating elements from a collection is. The way I have been doing it up until now is to simply convert the collection into a set. I know sets cannot have repeating elements so it just handles it for me. Is this an efficient solution? Wou...

How to launch email intent with an attached image

Hi, I am trying to launch an email intent with an attached jpg. I did: Intent intent4 = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "[email protected]", null)); startActivity(intent4); this launches the email activity. But when I try to add DataAndType (my jpeg attachment). It fails with android.content.ActivityN...

Render PDF on a Blackberry?

We are using Blackberries to display PDF reports. Here are background details on the problem: The PDF reports are created using JasperReports. Report format can be changed. Different report formats are available (as per the feature set of JasperReports). The PDF reports are on a website, too, so retaining a single source is ideal. The ...

Using Bing as local search

For an ajax app I'm doing, I was using the google local search api to help enter in address info. For example, if the user needs to fill out employment information, typing in the business name would provide a list of matching businesses, then clicking one would fill out all of the address fields. However, we can't use it because of the r...

Determine Whether Daylight Savings Time (DST) is Active in Java for a Specified Date

I have a Java class that takes in the latitude/longitude of a location and returns the GMT offset when daylight savings time is on and off. I am looking for an easy way to determine in Java if the current date is in daylight savings time so I can apply the correct offset. Currently I am only performing this calculation for U.S. timezon...

HTML Agility Pack or HTML Screen Scraping libraries for Java, Ruby, Python?

I found the HTML Agility Pack useful and easy to use for screen scraping web sites. What's the equivalent library for HTML screen scraping in Java, Ruby, Python? ...

lauch4j hello world program

I created a "hello world" java program and use lauch4j to convert executable jar to .exe file. When I tried to run it in cmd, but nothing printed out. I also tried to run it in launch4j. Log indicates: Executing: C:\Documents and Settings\cnbq84\Desktop\helloworld.exe. But still no "hello world" is displayed. How to display the "Hello W...

Does Oracle support Server-Side Scrollable Cursors via JDBC??

Hi all Currently working in the deployment of an OFBiz based ERP, we've come to the following problem: some of the code of the framework calls the resultSet.last() to know the total rows of the resultset. Using the Oracle JDBC Driver v11 and v10, it tries to cache all of the rows in the client memory, crashing the JVM because it doesn't...

Testing Quartz CronTrigger trigger

Assuming that I have a CronTriggerBean similar to <bean id="midMonthCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="reminderJobDetail" /> <property name="cronExpression" value="0 0 6 15W * ?" /> </bean> What is the best way to test that this bean will actually trigger...

Why is non-breaking space not a whitespace character in java?

While searching for a proper way to trim non-breaking space from parsed HTML, I've first stumbled on java's spartan definition of String.trim() which is at least properly documented. I wanted to avoid explicitly listing characters eligible for trimming, so I assumed that using Unicode backed methods on Character class would do the job fo...

Strange Classpath, .NoClassDefFoundError errors

Edited: SOLUTION FOUND. This is strange and not the best solution, but I just went ahead and put MY JAVA CODE (com.*) the classes in the swt.jar so that swt.jar and my classes are loaded at the exact same moment and by the same classloader. Not the best solution but a temporary fix Edited: I added most of the code here: http://groups...

Passing Files as Parameters

Hello. I have created an example to introduce my question. public class Algorithm { // This is the best, but circumstances prevent me from doing this. /*public static void computeSomething(Data data) { // Compute some stuff }*/ public static void computeSomething(DataFileReader reader) throws IOException {...

Java reflection and manifest file in jar

Hi all, I would like to (and I don't know if it's possible) do something if jarA is in my classpath and do something else if jarB is in my classpath. I am NOT going to be specifying these jars in the Netbeans project library references because I don't know which of the jars will be used. Now including the jar in my Netbeans project li...

Java web development using Eclipse - Tutorial

I need some step by step tutorials/documents on developing Java web applications using Eclipse/apache. appreciate directions/help. ...