I have the next code:
Process p = Runtime.getRuntime().exec(args);
and I want my program to wait for the Runtime.getRuntime().exec(args); to finish cause it last 2-3sec and then to continue.
Ideas?
Does anyone know of a tool (besides Eclipse or any other IDE) that I can use to find unused imports in a Java source file?
I am looking for a command-line type of tool (to integrate in a larger script).
Thank you.
I want to show a box in 3d on my website, and I was thinking to do it in Flash. How I can show a 3d model?
I need something very simple, it's a textured cube, no interaction required, just let the user pan and zoom.
There is a 3ds viewer in flash or something like that?
Java is also ok (but flash is preferred)
What is the best procedure for storing and retrieving, using native Java serialization, generic objects like ArrayList<String>?
Edit: To clarify. When I serialize an object of type ArrayList<String> I'd like to de-serialize to the same type of object. However, I know of no way to cast back to this generic object without causing warnings.
Need: Output a Java application's log into a GUI component, such as a JTextArea.
Concern: Need to log things from any class, in a static manner. However, the GUI logger component must not be static (obviously) as it's the member of a parent component.
What should I do?
Hello,
I'm creating a java web application runing on a Tomcat server.
One of the functions fill in a StringBuffer variable with data.
At the end, I would like to propose the user to download the generated content packaged in a text file. This without having to store the file on the server.
I've been searching for a code snippet but couldn't find anything corresponding ...
I hope I've been clear enough on my problem.
Thanks in advance,
Hi all,
I need to create daemon that will monitor certain directory and will process every file that's written to that particular path.
My choice is either java or python.
Did you guys have any experience using both technology? what is the best one?
Hi.
I wanted a thing like I declare a variable: String a = "test";
And want to know what type it is, i.e., the output should be java.lang.String
thanks in advance
In my code I am using java.sql.PreparedStatement.
I then execute the setString() method to populate the wildcards of the prepared statement.
Is there a way for me to retrieve (and print out) the final query before the executeQuery() method is called and the query is executed? I Just want this for debugging purposes.
Thanks.
Why is it that in Java, a superclass' protected members are inaccessible by an indirect subclass in a different package? I know that a direct subclass in a different package can access the superclass' protected members. I thought any subclass can access its inherited protected members.
This problem occurs over and over. I have some complicated object, such as a Cat, which has many properties, such as age, favorite cat food, and so forth.
A bunch of Cats are stored in a Java Collection, and I need to find all the Cats that are aged 3, or those whose favorite cat food is Whiskas. Surely, I can write a custom method that finds those Cats with a specific property, but this gets cumbersome with many properties; is there some generic way of doing this?
In .NET you can achieve something like this:
Color yellowColor = Color.FromName("yellow");
Is there a way of doing this in Java without having to resort to reflection?
PS: I am not asking for alternative ways of storing/loading colors. I just want to know wherever it is possible to do this or not.
I have a Java application complied to a collection of jars that I want to make installable on Ubuntu and SuSE. I Want the installer to be able to check for the JRE, register a file association and be able to load a website on un-install.
I understand Ubuntu and SuSE are based on different architectures, so is there a consistent way to do this?
Does anyone have an advice on utilities to use or guides to read to help me achieve what I'm trying to do.
How would one go about proving to management that a batch reformat of all .java files in a large code base (to place the code in compliance with the company's coding standards) is safe and will not affect functionality.
The answers would have to appease the non-technical and the technical alike.
Does anyone overload the equals method in java? The overloaded method will be
public boolean equals(final MyClass myClass)
This will have the benefit of having the relevant comparison part (guts of the method) in another method.
Details are in this blog.
Using JNI can we pass custom data types from Java to C (or vice versa)? I see a mapping of primitive datatypes to types in C however not too sure if we can send across our own data types (e.g. Send across or return an Employee object or something!).
Hi,
After some serious googleing I found out that the RandomAccessFile-class is not thread-safe. Now I could use one semaphore to lock all reads and writes but I don't think that performs very well. In theory it should be possible to do multiple reads and one write at a time.
How can I do this in Java? Is it possible at all?
Thanks!
Hello,
I am writing a user defined function to DB2 on AS/400 in Java and the strangest thing happen..
I am always getting the same result from the function even when i am changing it, even if i am dropping it and create it again and even when i specify NOT DETERMINISTIC..
Does any one have ever encountered a behavior like that?
Having played with Linq (to SQL and Objects) as well as the Entity Framework from Microsoft recently, I was wondering what the non-.Net (specifically Java) equivalents are?
I know in Jython you can do
import java.util.Random as Random
Random().nextInt()
But if I have a class I wrote myself, how can I import it into Jython without putting the class itself in a package? If I have a testclass Test:
public class Test {
public void foo() {
System.out.println("bar");
}
}
that's not inside a package. Can I even import that into jython by using something along the lines offrom Test import Test?
I need to use a few Cyrillic characters in a Java file and in order for Eclipse to allow me to do so I need to change the encoding for that file (currently to UTF-8).
Are there any possible problems that this could cause?
If i make java core dump with gcore then what is the best tool to analyze it? I need to be able make jmap, jstack, jstat etc and also i need to see values of all variables.
Something that can take core dump as frozen JVM.