Stuckness shouldn't be avoided. It's the psychic predecessor of all real understanding. An egoless acceptance of stuckness is a key to an understanding of Quality, in mechanical work as in other endeavors. It's this understanding of Quality as revealed by stuckness which so often makes self-taught mechanics so superior to institute-trained men who have learned how to handle everything except a new situation. - Robert Pirsig, Zen and the Art of Motorcycle Maintenance
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Wednesday, July 28, 2010
Saturday, June 26, 2010
Profiling Java Application with Netbeans on Ubuntu
Currently this requires installing the "Java Profiler" plugin from within the IDE > Tools > Plugins. Then follow the same steps as for profiling in Windows.
Profiling Java Application with Netbeans on Windows
For profiling with netbeans, I followed the steps as described in the Netbeans IDE 6.8 under "Profile > Profile Project" and "Profile > Attach Profiler". At first, I created a new ant target as:
<target name="run-prof">
<exec dir="${deploy.dir}" executable="cmd" os="Windows 2003" output="runmaster.output.txt">
<env key="HOME" value="C:code">
</env>
<arg line="/c run.bat">
</arg>
</exec></target>
and then to attach the target to the profiler, I replaced the call to "run.bat" with a call to "run_nbproject.bat" as described under the "Attach Profiler" widget. I also set the filters to include "jboss.*".
<target name="run-prof">
<exec dir="${deploy.dir}" executable="cmd" os="Windows 2003" output="runmaster.output.txt">
<env key="HOME" value="C:code">
</env>
<arg line="/c run.bat">
</arg>
</exec></target>
and then to attach the target to the profiler, I replaced the call to "run.bat" with a call to "run_nbproject.bat" as described under the "Attach Profiler" widget. I also set the filters to include "jboss.*".
Tuesday, June 8, 2010
Using JNI with JBoss
For using JNI with JBoss, it is necessary to put the JNI Java wrapper inside the deployment directory of the JBoss server.
I also used the following settings for JNI to work:
I also used the following settings for JNI to work:
- set java.library.path to include the path to the .so file
- set java.ext.dirs to include the path to the .jnilib file (not sure if this is needed)
Monday, May 31, 2010
Installing OpenCV for Java on Ubuntu 10.04
In this article I discuss how I set up OpenCV with Java on my Ubuntu 10.04. Primarily, I followed the process described at http://ubaa.net/shared/processing/opencv/ but with several changes (when I was stuck in the middle due to the old version used in the installation at the site).
First, I installed OpenCV on Ubuntu using sudo apt-get install libcv-dev
Then, I put the openCV wrapper files known as "Processing OpenCV Library" from (this is the version that worked on my installation):
http://ubaa.net/shared/processing/opencv/download/2.0/beta/opencv-linux_2.0b.tar.gz
in a dir1 and then added to my JVM options java extensions directory as specified on the Processing page: -Djava.ext.dirs=dir1
First, I installed OpenCV on Ubuntu using sudo apt-get install libcv-dev
Then, I put the openCV wrapper files known as "Processing OpenCV Library" from (this is the version that worked on my installation):
http://ubaa.net/shared/processing/opencv/download/2.0/beta/opencv-linux_2.0b.tar.gz
in a dir1 and then added to my JVM options java extensions directory as specified on the Processing page: -Djava.ext.dirs=dir1
I also had to install libcvaux-dev to resolve some link errors: sudo apt-get install libcvaux-dev.
For the Face Detection to work, I had to set the cascade using OpenCV::cascade function before the OpenCV::detect call. After this, the example FaceDetection.java worked for me.
Sometime soon I needed the class file for PImage at run time. For this, I downloaded Processing from http://processing.org/download/processing-1.1.tgz. Then I put the directory containing core.jar (dir2) also in the java extensions setting above. That is,
-Djava.ext.dirs=dir1:dir2
For the Face Detection to work, I had to set the cascade using OpenCV::cascade function before the OpenCV::detect call. After this, the example FaceDetection.java worked for me.
Sometime soon I needed the class file for PImage at run time. For this, I downloaded Processing from http://processing.org/download/processing-1.1.tgz. Then I put the directory containing core.jar (dir2) also in the java extensions setting above. That is,
-Djava.ext.dirs=dir1:dir2
Tuesday, December 15, 2009
Using Multiple Java versions
For building Katta, I needed to use Java 6 (compilation did not work with Java 1.5). Now I have two java versions installed on my dev laptop. To make use of Java 6, I just needed to set JAVA_HOME and PATH appropriately (export PATH=$JAVA_HOME/bin:$PATH) and then the compilation worked fine.
Subscribe to:
Posts (Atom)