java

I want to run an scons command in my current directory. How do I do this in Java?

I am using Java to automate a build. I would like to run an 'scons' command in the current directory in which the build is being performed. How can I do this with Java? I have tried Runtime.getRuntime().exec(CurrentDir + commandString) This didn't work. Any ideas would be greatly appreciated. ...

GhostDoc for NetBeans

Anyone know of a product similar to GhostDoc for the NetBeans IDE? ...

SSL communication, how hard can it be?

I have a Java main application running on my PC that can send XML data to a servelet and recieve XML data back. http://iamt.wisconsin.gov/IAM-WiEntUser/WiEntUserService?xml= I can use https://iamt.wisconsin.gov/IAM-WiEntUser/WiEntUserService?xml= from IE and Firefox because I they allowed me to load the private certificate. I want to u...

GUI creation code layout theory?

This question is not so much a "How to create a gui", but more of a "where to create the gui". I have some java code that checks to make sure the drivers needed are in place: public boolean confirmDrivers() { /* some logic */ return someDriver.exists(); } it gets called as: if (confirmDrivers()) { createGUI();...

winforms panels vs java swing panels

In java swing I can insert panels into panels and so on, and not have to build a brand new window for every view of my applicaiton, or mess around removing and adding controls. Theres a panel clas sin C# however I cant see any way of creating a 'panel form' or basically just a form in form designer thats a panel and its contents. How d...

Can you get the previous value of a variable in Java?

Say way have a variable (let's say String Str) and the value of Str starts of as " " then as some code is running it is set to "test" then somewhere else in the code it is changed again to say "tester". Now in the program I want to find out what the previous value of Str was. Is this possible in Java? So I am saying that the variable ge...

Where are the form settings of the Swing Application Framework stored?

I want to delete them, because for some reason my forms are restored to the wrong dimensions on startup. I didn't find anything in my user directory, but I'm not event sure what to look for. I'm interested about Windows and Linux. ...

Can the JVM provide snapshot persistence?

Is it possible to dump an image of a running JVM and later restore the previous state by loading the image into the JVM? I'm fairly certain the answer is negative, but would love to be wrong. With all the dynamic languages available for the JVM comes an increase in interactivity, being able to save a coding session would help save time...

Rewrite C code in Java or use JNI?

I'm currently developing on a project written in Java. We have a bunch of algorithms written in C/C++ (at least a couple hundred) that need to be incorporated in our project. Our two options are to use JNI to call this code, or to rewrite all the algorithms in Java. I am aware of the consequences of using JNI, it can open up a whole n...

Unexpected result from HttpURLConnection - reading remote binary file.

I'm trying to read a remote binary file (say, image) from internet like this: HttpURLConnection connection = (HttpURLConnection) myUrl.openConnection(); //myUrl - URL object pointing for some location if(connection.getResponseCode() == 200){ File temp = File.createTempFile("blabla", fileName); //fileName - string name of file Fi...

How can I pass data from Perl to Java?

I'm working on some Java <-> Perl interaction. I would like to know what the best way is to pass information from Perl to Java. (Great answers about Perl and Java here and here btw). There's a lot of text and XML(XML::Twig) I'm parsing in Perl, in a script I'm supposed to call from a Java Web App. So I have all this gathered data, and I...

Tomcat is unable to find my Servlet and is throwing exceptions, but why?

I'm trying to get into Java web development but seem to be running into a strange issue with Tomcat and an extremely simple servlet. The catalina log is spewing this every time I try and load the app: Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name MyServlet at org.apache.catalina.cor...

Now that we have annotations in java, is xdoclet legacy?

I came accross the xdoclet project and see it enjoys/ed high popularity. So the question is, now that we have annotations in java: is xdoclet legacy? Or is there something to xdoclet I didn't see/understand. ...

Java floating point math - (conversion for feet/meters)

Pretty basic question I think - I'm performing this function: private double convertMetersToFeet(double meters) { //function converts Feet to Meters. double toFeet = meters; toFeet = meters*3.2808; // official conversion rate of Meters to Feet return toFeet; } Problem is the output; for example I get 337.360800000...

What to do with Java BigDecimal performance?

I write currency trading applications for living, so I have to work with monetary values (it's a shame that Java still doesn't have decimal float type and has nothing to support arbitrary-precision monetary calculations). "Use BigDecimal!" — you might say. I do. But now I have some code where performance is an issue, and BigDecimal is mo...

java inputstream read blocking

According to the java api, the InputStream.read() is described as: If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. I have a while(true) loop doing a read and I a...

Which Java oriented lexer parser for simple project (ANTLR, DIY, etc)

I am working on a small text editor project and want to add basic syntax highlighting for a couple of languages (Java, XML..just to name a few). As a learning experience I wanted to add one of the popular or non popular Java lexer parser. What project do you recommend. Antlr is probably the most well known, but it seems pretty complex...

Fail to install my NetBeans plugin

Playing around with creating a NetBeans plugin but I am making very little progress since the process of installing the module fails. What I am doing is right-clicking on the and choosing the 'Install/Reload in Development IDE' option and it fails with the following exception: Enabling StandardModule:org.willcodejavaforfood.com jarFile:...

How do Java classes get information from the Entry class?

So lets say that in my entry point class (i.e the class which runs when the program starts (which has the public static void main(String args[]) function). In that class I have this variable: private ArrayList<String> myData=new ArrayList<String>(); This class instantiates another class, which needs to have access to the myData member...

Online (preferably) lookup API of a word's class.

I have a list of words and I want to filter it down so that I only have the nouns from that list of words (Using Java). To do this I am looking for an easy way to query a database of words for their type. My question is does anybody know of a free, easy word lookup API that would enable me to find the class of a word, not necessarily i...