java

How to recreate shortcut to webstart application?

I use the shortcut tag in my appliation's jnlp descriptor to create a desktop link and a menu entry for my application. If these shortcuts get deleted on the client - how can they be reinstalled automatically without user action? Is there a configuration option for the jnlp file? (btw I'm using java6) ...

running a java program as an exe in windows without JRE installed

Hi I want to run a java program as an exe in windows the windows box doesnt install java at all... So, is there any other way in which the java program can be converted to exe which takes of this JRE dependencies etc??? Thanks Shiv ...

Pthread id from pthread_self() doesn't match data from dtrace script

I'm using this dtrace script from here to try to find when context switches occur for the threads of a java program. I'm trying to match the data gathered from the script with trace data gathered from the running program (things like method entry/exit). I get the pthread id of the running thread using a short JNI method that simply ret...

How do I get a Java program I installed running?

I downloaded a program implemented in Java (in this case, http://julian.togelius.com/mariocompetition2009/index.php). I first tried opening the Play.class file with Java, but it spit out an error i couldn't see because the console window disappeared so fast. I replicated this on the command line, and got the following error: Exception i...

How to determine whether java is installed on a system through python?

Hi, i needed to run a jar file from python code,but before running that file i want to know whether java is installed on the system or not, using the python code itself.Please help thanks ...

Invalid Oracle URL specified: OracleDataSource.makeURL

I'm trying to connect to a local oracle database but I'm getting this cryptic error message: Invalid Oracle URL specified: OracleDataSource.makeURL. I'm pretty sure this is due to an error with the database connection parameters I'm passing, but really, this error message does not help me in any way. Any hints as to what I'm doing wron...

Things to be considered while building a framework

We are planning to build a framework: a cost-estimation framework that will be used across the domains in our organization. The high-level requirement is something like this : If I develop a certain product, how much will it costs me? This generated cost will be used to compare with the cost the vendors have quoted and to come-up with ...

Netbeans 6.5 debug issue

I am debugging the following lines of code if (var.getvar2() != var3) { var4.add(var); } else { isNeeded= true; if (incomingPublishedDate.compare(modifiedDate) < 0) { importNeeded = true; } else { var4.add(var); } } Here var.getvar2() a...

regexes for parsing formatted numbers

I am parsing documents which contain large amounts of formatted numbers, an example being: Frc consts -- 1.4362 1.4362 5.4100 IR Inten -- 0.0000 0.0000 0.0000 Atom AN X Y Z X Y Z X Y Z 1 6 0.00 0.00...

Lazy query.list() in Hibernate?

I am using Hibernate 3.3.2 GA + Annotations. Is there a way get a lazy list back when calling list() on a query? The documentation (19.1.3) remarks: list() does not usually return proxies. The question is: how do I make it return proxies (or more perhaps more precisely one proxy which returns entity instances during the actual ite...

Why is my JNDI lookup for a QueueConnectionFactory returning null?

I am trying to look up a QueueConnectionFactory and Queue via Geronimo's JNDI. The Queue gets returned fine, but the QueueConnectionFactory lookup always returns null. It doesn't throw a NamingException, which is what I'd expect if the JNDI name was incorrect. Can anyone see what I'm doing wrong? The test code below outputs: true fals...

How do I get the hosts mac address using Java 5?

I know you can do this with Java 6 using java.net.NetworkInterface->getHardwareAddress(). But the environment I am deploying on is restricted to Java 5. Does anyone know how to do this in Java 5 or earlier? Many thanks. ...

How to update a GUI from another thread in Java

Hi, I am writing a desktop application using SWT. What is the simplest way to update GUI controls from another thread? ...

Is there a simple framework allowing for Dependency Injection in a stand alone program?

We basically need to be able to adjust behaviour at start-up time, by providing desired classes to be produced by various factories inside our application (to avoid the hard binding of the "new" operator). I am aware that this is provided by several large frameworks, but I was looking for something easily used by a stand-alone Java appl...

How to get updated jnlp file when using shortcuts?

If my jnlp descriptor on the server changes and I start my application from the browser, a new jnlp file will be created in the cache and my desktop shortcuts will be updated to use the new jnlp file. (that's good so far). But if I start my app using the desktop shortcut (or the menu entry), then my app won't know about the changed jnlp...

Negating a set of words via java regex!

Hi folks, I would like to negate a set of words using java regex. Say, I want to negate cvs, svn, nvs, mvc. I wrote a regex which is ^[(svn|cvs|nvs|mvc)]. Some how that seems not to be working. Could you please help? Thanks. .\J ...

What is the right way to change an Integer in a Vector in Java (j2me)

As a follow up to my question about j2me dynamic arrays, I'm now trying to figure out a way to change the values of the Integers in my Vector. Say I have a Vector v, and Array arr, and ints x, y and i; In c++ I could do: v[arr[x][y]] += i; In j2me the best way I found so far to do the same is: v.setElementAt(new Integer(((Integer)...

PostgreSQL identity in JPA single table hierarchy

I'm seeing strange behaviour when using PostgreSQL in a Hibernate/JPA environment with a single table inheritance hierarchy. Firstly my environment: PostgreSQL 8.3 Spring 2.5.6SEC01 Hibernate-entitymanager 3.4.0.GA (installed from Glassfish update tool) Hibernate-distribution 3.3.1.GA (installed from Glassfish update tool) Glassfish V...

Java to C# converter.

Does anybody know what the standard Java to C# converter is. Bob. Edit: Possible Duplicate: http://stackoverflow.com/questions/443010/where-can-i-find-a-java-to-c-converter ...

XMLGregorianCalendar date comparison

How do i compare 2 instances of XMLGregorianCalendar to find which one is greater? One of the date variables have a value date1 = 2009-02-23T05:54:17+05:30 and the other, date2 = 2009-02-23T05:54:17.000 ...