I use a large (millions) entries hashmap to cache values needed by an algorithm, the key is a combination of two objects as a long. Since it grows continuously (because keys in the map changes, so old ones are not needed anymore) it would be nice to be able to force wiping all the data contained in it and start again during the execution, is there a way to do effectively in Java?
I mean release the associated memory (about 1-1.5gb of hashmap) and restart from the empty hashmap..
I would like to program Java servlets using Eclipse and I plan on deploying them using Tomcat. I think I can build the projects using Ant which is bundled with Eclipse. I have the standard Eclipse IDE. What options do I have for doing Servlet development in Eclipse? What changes do I need to make to Eclipse? Do I need to install a plug-in?
In C# you can easily read all classes from a given assembly.
I'm looking for equivalent feature in Java. I need this to automatically bind EJB beans to my Guice Module.
Does anyone know what approach one can take to automatically generate Java source code, from for example an xml or json file, in eclipse?
One great example of what I am thinking of doing is what Google Android sdk does: they have an R class generated automatically from the resources.
Every time a resource file is saved in Eclipse R class is automatically regenerated.
Thanks!
I'm running an application from inside another one for testing pusposes. I want to redirect the output for the tested app to a file, so I can have a log after each test.
Is there to redirect the output of an app to a file from the command line in java?
I'm coding a software on java and i almost finished, i would like to know how can we create a trial version which work for example for 30 days, because i will to send it to some companies
so how to make it like shareware or trialware, also can we block access to the .class in the jar file?
Thank you
I need to determine the current state of the Shift key, but at the time I need the state I don't have an InputEvent object around. I need something like java.awt.Toolkit.getLockingKeyState(int) that works for Shift, not just the locking keys like VK_CAPS_LOCK. Is there a way I can do this without listening to input events and storing the for later when I need to check the state?
Thanks!
I want to make Java JDialog appear like it is presented in the [Image][1]
[1]: http://lh4.ggpht.com/_AnzmYq61hHI/S8RTAznktKI/AAAAAAAAAW0/c4HVCuchdjc/s1600-h/saveConfiguration%5B2%5D.jpg using JDK 6 Swing. Is it possible? if so kindly guide me.
Image Link
Hi,
After I read Bloch's discussion http://www.infoq.com/news/2010/04/bloch_java_future
I started to think about "Do I have to switch to scala for new web developements" or is java preferred in all cases. What is your opinion ?
Thanks,
Hello,
I have a test class that has a @Resource annotation for a setter and I need to make it Java 1.4 compliant, so obviously the annotation has to go. I'm using Spring.
So, how would I replace something like @Resource("my.resource") so that the setter gets the correct dependency injection? Would I need to make a bean in an xml file?
I'm pretty new to this so if I'm not providing enough information, let me know.
Is it possible to write objects in Java to a binary file? The objects I want to write would be 2 arrays of String objects. The reason I want to do this is to save persistent data. If there is some easier way to do this let me know.
Thanks in advance!
Hi there,
I created a program that contains linked lists that are passed various methods. While this works just fine in Java... a style checker program we have to use doesn't like it
It says: Declaring variables, return values or parameters of
type 'LinkedList' is not allowed.
If I declare them as simply List then I don't have access to the methods I want. What should I do?
Hi crew,
I'm searching for a tool, which converts a jsp file into a java file without using a server like tomcat or something else.
Can anyone help me out?
I have one SDK that is available in Java and another SDK that is available for .Net and would like to write a single application that interfaces with both of them. I imagine I will need to use a cross platform communication framework that can support named pipes (or other in memory communication), what is the best choice?
After some more research I found Hessian -- does anyone know anything about the maturity of this project?
Hi there,
is it possible to start a new thread in a different process in Java?
I mean, I'm running a specific process and main thread, issuing ProcessBuilder for creating a new process. Before start() method is invoked, one must provide the command to be run in another process. Is it possible to start a new thread in newly created process?
Thank you in advance for the reply.
Best regards.
I see many similar questions, however I want to find the Username of the currently logged in user using Java.
Its probably something like:
System.getProperty(current.user);
But, I'm not quite sure.
Hi, implementing service something similar with tinyurl or bit.ly, I'm would like to expose service as API, I'm using java and jersey as RESTfull service implementation.
I'm looking for simplest way for authentification of users who use API, OAuth is first thing coming in mind, but the problem is I don't need this 3 iteration calls with request token query, than access token query with callback url passing. I just need to give user ability to invoke api with no additional security calls to my server.
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?
There was an earlier thread on Java graph or chart library, where JFreeChart was found to be quite good, but, as stated in its FAQ, it's not meant for real-time rendering.
Can anyone recommend a comparable library that supports real-time rendering? Just some basic xy-rendering - for instance, getting a voltage signal from data acquisition system and plotting it as it comes (time on x-axis, voltage on y-axis).
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.