Program paths under linux

Hallo,
I need in my application to launch specific programs (common ones like firefox, adobe etc..). I could find the following posting, which gives the path of the installed software by passing the software name (like firefox.exe), under windows. My question is how to do the same under linux?!
public class FindProgramOnWindows
     public String find(String exeName)
          String path = "";
          try
               Process r = Runtime.getRuntime().exec("reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\\" +"Microsoft\\Windows\\CurrentVersion\\App Paths\\" + exeName + "\"");
               BufferedReader buffer = new BufferedReader(new InputStreamReader(r.getInputStream()));
               String line = "";
               String exeNameRegexp = exeName.replaceAll("\\.", "\\\\.");     
               Pattern p = Pattern.compile(".+\\w:\\\\.+" + exeNameRegexp,Pattern.CASE_INSENSITIVE);
               while ((line = buffer.readLine()) != null)
                    Matcher m = p.matcher(line);
                    m.matches();
                    if (m.matches())
                         String param[] = line.split("\t");
                         path = param[param.length-1];
                         break;
               buffer.close();
          } catch (Exception e)
               e.printStackTrace();
          return path;
}Thankefully
Christian Rosenfeld

As differemt Linux distributions install programs in different folders in combination with no central program registry, I would say that either you have to communicate with installation package managers (apt, rpm) or search in to common folders for the program name, e.g. /usr/bin /usr/local/bin /opt/bin ...

Similar Messages

  • Exception in html parser under Linux

    Hi all,
    Following code is copied from Tech Tip 23Sep1999. I have compiled it and run it under Win98. It works fine for any uri. However, when I try to run it under Linux, it throws exceptions. I noticed that some web site can be parsered with the program in Linux but some can't. I wonder the different between those platforms. Anyone can tell me how to make the program works under Linux.
    Rgds,
    unplug
    configuration
    RedHat 7.1
    JDK1.3.1
    Failed: java GetLinks http://java.sun.com
    Worked: java GetLinks http://www.apache.org
    --begining of code
    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    class GetLinks {
    public static void main(String[] args) {
    EditorKit kit = new HTMLEditorKit();
    Document doc = kit.createDefaultDocument();
    // The Document class does not yet
    // handle charset's properly.
    doc.putProperty("IgnoreCharsetDirective",
    Boolean.TRUE);
    try {
    // Create a reader on the HTML content.
    Reader rd = getReader(args[0]);
    // Parse the HTML.
    kit.read(rd, doc, 0);
    // Iterate through the elements
    // of the HTML document.
    ElementIterator it = new ElementIterator(doc);
    javax.swing.text.Element elem;
    while ((elem = it.next()) != null) {
    SimpleAttributeSet s = (SimpleAttributeSet)
    elem.getAttributes().getAttribute(HTML.Tag.A);
    if (s != null) {
    System.out.println(
    s.getAttribute(HTML.Attribute.HREF));
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    // Returns a reader on the HTML data. If 'uri' begins
    // with "http:", it's treated as a URL; otherwise,
    // it's assumed to be a local filename.
    static Reader getReader(String uri)
    throws IOException {
    if (uri.startsWith("http:")) {
    // Retrieve from Internet.
    URLConnection conn=
    new URL(uri).openConnection();
    return new
    InputStreamReader(conn.getInputStream());
    } else {
    // Retrieve from file.
    return new FileReader(uri);
    --End of code
    --Exception in Linux
    Exception in thread "main" java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at java.awt.Toolkit$2.run(Toolkit.java:512)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:503)
    at javax.swing.text.html.CSS.getValidFontNameMapping(CSS.java:932)
    at javax.swing.text.html.CSS$FontFamily.parseCssValue(CSS.java:1789)
    at javax.swing.text.html.CSS.getInternalCSSValue(CSS.java:531)
    at javax.swing.text.html.CSS.addInternalCSSValue(CSS.java:516)
    at javax.swing.text.html.StyleSheet.addCSSAttribute(StyleSheet.java:436)
    at javax.swing.text.html.HTMLDocument$HTMLReader$ConvertAction.start(HTM
    LDocument.java:2536)
    at javax.swing.text.html.HTMLDocument$HTMLReader.handleStartTag(HTMLDocu
    ment.java:1992)
    at javax.swing.text.html.parser.DocumentParser.handleStartTag(DocumentPa
    rser.java:145)
    at javax.swing.text.html.parser.Parser.startTag(Parser.java:333)
    at javax.swing.text.html.parser.Parser.parseTag(Parser.java:1786)
    at javax.swing.text.html.parser.Parser.parseContent(Parser.java:1821)
    at javax.swing.text.html.parser.Parser.parse(Parser.java:1980)
    at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java
    :109)
    at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.ja
    va:74)
    at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:239)
    at GetLinks.main(GetLinks.java:23)

    Support for CSS and clearly defined.Also Dictionary getDocumentProperties() is not properly exaplained meaning it doesnt give methods to get all the properties a HTML document can have.

  • External program under Linux

    hello
    how run external program under Linux OS from my java application ?

    You need Runtime.exec() and you can save yourself a lot of grief and time by reading http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html.
    Once you have read it, read it twice more!

  • Java running under linux with crontab

    I'm having a problem:
    i want to run a java program under linux with crontab.
    my classes are in a directory and aren't in a package. i run em by invoking ./start which is a small script that i wrote. The script is in the same dir as the classes and invokes java by "java Main >>logjava.txt " but this doesn't seem to work all i get is an empty logfile
    i need to run the program every day at 0800 so i inserted the following in crontab:
    0 8 * 1-5 /var/"path"/start > logjava (where path is the path to the classes dir)
    if i run the cmdline from anywhere on the prompt i get the result i want. I think it's because the cron runs it from the root dir thus making java unable to find the classes
    Any suggestions would be welcome. or can some1 tell me how to make linux executables from the java (i usually use jsmooth for the windows exe)

    You can execute several commands in the process started by cron. You separate them using semicolons.
    Have you tried a cron entry like this:
    0 8 * 1-5 cd /var/"path";pwd;echo $PATH; ./start > logjavaOr, you may need to make sure the process started by cron gets the same environment as your interactive shells do, by explicitly loading your setup or .login scripts:
    0 8 * 1-5 . $HOME/.setup;cd /var/"path";pwd;echo $PATH; ./start > logjava

  • Crash (SIGSEGV, SIGILL) of 32bit Hotspot under Linux x86_64 in VMware

    Hello!
    A reproducible crash of these 1.6 32 bit Java VMs is hinderung my application from starting when I want to start it under a x86_64 Linux kernel in VMware (Workstation and ESX):
    - java version "1.6.0_06"
    Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
    Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)
    - java version "1.6.0_06"
    Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
    Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)
    - java version "1.6.0_10-beta"
    Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b23)
    Java HotSpot(TM) Client VM (build 11.0-b11, mixed mode, sharing)
    Tested using there kernels:
    - Linux debian 2.6.18-6-amd64 #1 SMP Sun Feb 10 17:50:19 UTC 2008 x86_64 GNU/Linux
    - Linux openSUSE 2.6.22.5-31-default #1 SMP 2007/09/21 22:29:00 UTC x86_64 x86_64 x86_64 GNU/Linux
    - Linux sles10-sp1-sdm 2.6.16.46-0.12-default #1 Thu May 17 14:00:09 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux
    Sproradic but reproducible JVM (Hotspot) crashes while running a simple garbage collector stress application several times in parallel. hs_err files are generated each time. However, the "Problematic frame" address and library changes every time!
    Examples:
    # Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode, sharing linux-x86)
    # Problematic frame:
    # C [libc.so.6+0xe4c9d] xdr_u_long+0xd
    VM state:not at safepoint (normal execution)
    # Java VM: Java HotSpot(TM) Server VM (10.0-b22 mixed mode linux-x86)
    # Problematic frame:
    # C 0xf7f56acb
    VM state:at safepoint (normal execution)
    # Java VM: Java HotSpot(TM) Server VM (10.0-b22 mixed mode linux-x86)
    # Problematic frame:
    # C [libnss_compat.so.2+0x2e16] nsscompat_getpwnam_r+0x46
    VM state:synchronizing (normal execution)
    The problem only appears using JDK or JRE 1.6 32 bit edition on a Linux 2.6 x86_64 kernel in VMware. Tests using real hardware, using a i686 kernel and using JDK / JRE 1.6 64 bit edition or JDK / JRE 1.5 (32 bit and 64 bit) could not reproduce the crashes.
    Questions:
    - Is there a general stability problem when starting the 32 bit Java VM under Linux 64?
    - Does anybody have similar problems with
    - Java VM 32bit under Linux 64?
    - Java VM in VMware (both ESX and Workstation)?
    Simple stress test application:
    public class GCStress {
    private static Thread[] threads;
    private static java.util.Random random = new java.util.Random();
    private static int maxBytes;
    private static int numThreads;
    public static void main(String[] args) {
    numThreads = Integer.parseInt(args[0]);
    maxBytes = Integer.parseInt(args[1]);
    threads = new Thread[numThreads];
    for (int x = 0; x < numThreads; x++) {
    threads[x] = new Thread(new Allocator(), "Thread_" + x);
    threads[x].start();
    while (true) {
    for (int x = 0; x < numThreads; x++) {
    if (!threads[x].isAlive()) {
    threads[x] = new Thread(new Allocator(), "Thread_r" + x);
    threads[x].start();
    try {
    Thread.sleep(500);
    } catch (InterruptedException e) {
    // ignore
    private static class Allocator implements Runnable {
    public void run() {
    while (true) {
    int tSize = random.nextInt(maxBytes);
    // System.out.println(Thread.currentThread().getName()
    // + " allocating " + tSize / 1024 + "kb");
    byte[] tMemFiller = new byte[tSize];
    try {
    Thread.sleep(random.nextInt(200));
    } catch (InterruptedException e) {
    ; // ignore
    }

    The program is started like this:
    ./jdk1.6.0_06/bin/java -server -Xms32m -Xmx256m GCStress 500 10485760
    And I run it usually 5 times in parallel. 1 time seems not to be enough (I should test that tonight).
    However, I've tested using several -XX: flags, but nothing really helped! (-XX:+UseParallelGC, -XX:-UseTLAB, -XX:+UseSpinning -XX-UseThreadPriorities, -XX:-UseBiasedLocking, -XX:-UseLargePages)
    About the lib: Every time, the content of hs_err is very different. I've also got
    hs_err_pid6201.log:# Problematic frame:
    hs_err_pid6201.log-# C [libc.so.6+0x5a261] IOwfile_seekoff+0x3b4
    hs_err_pid7116.log:# Problematic frame:
    hs_err_pid7116.log-# C 0x36343238
    hs_err_pid7137.log:# Problematic frame:
    hs_err_pid7137.log-# C 0xf7f17f67
    hs_err_pid7192.log:# Problematic frame:
    hs_err_pid7192.log-# C [libc.so.6+0x9d1ae]
    hs_err_pid7223.log:# Problematic frame:
    hs_err_pid7223.log-# C [libc.so.6+0xfef67] __register_frame_info+0xf
    hs_err_pid7232.log:# Problematic frame:
    hs_err_pid7232.log-# C [libc.so.6+0x109cdc]
    hs_err_pid7239.log:# Problematic frame:
    hs_err_pid7239.log-# C [libc.so.6+0x212b3] __newlocale+0x233
    hs_err_pid8569.log:# Problematic frame:
    hs_err_pid8569.log-# C [libc.so.6+0x562b9] IOgetline_info+0x52
    hs_err_pid8571.log:# Problematic frame:
    hs_err_pid8571.log-# C [libc.so.6+0x2b3] rtldglobal+0x2b3
    hs_err_pid8573.log:# Problematic frame:
    hs_err_pid8573.log-# C [libc.so.6+0x9b2b9]
    hs_err_pid8596.log:# Problematic frame:
    hs_err_pid8596.log-# C [libc.so.6+0x2e2d1]
    hs_err_pid8615.log:# Problematic frame:
    hs_err_pid8615.log-# C 0xf7e462b3
    hs_err_pid8635.log:# Problematic frame:
    hs_err_pid8635.log-# C [libc.so.6+0x9148c] glob64+0x40d
    hs_err_pid8642.log:# Problematic frame:
    hs_err_pid8642.log-# C [libc.so.6+0x722b9]
    hs_err_pid8667.log:# Problematic frame:
    hs_err_pid8667.log-# C [libc.so.6+0x67261]
    hs_err_pid9957.log:# Problematic frame:
    hs_err_pid9957.log-# C [libc.so.6+0xc5265]
    libnss is linked during execution:
    hs_err_pid7192.log:f7d77000-f7d7e000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7192.log:f7d7e000-f7d80000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7223.log:f7d6e000-f7d75000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7223.log:f7d75000-f7d77000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7232.log:f7db0000-f7db7000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7232.log:f7db7000-f7db9000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7239.log:f7dbc000-f7dc3000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid7239.log:f7dc3000-f7dc5000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8569.log:f7d4c000-f7d53000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8569.log:f7d53000-f7d55000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8571.log:f7da2000-f7da9000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8571.log:f7da9000-f7dab000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8573.log:f7d07000-f7d0e000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8573.log:f7d0e000-f7d10000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8596.log:f7d74000-f7d7b000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8596.log:f7d7b000-f7d7d000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8615.log:f7de0000-f7de7000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8615.log:f7de7000-f7de9000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8635.log:f7d27000-f7d2e000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8635.log:f7d2e000-f7d30000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8642.log:f7d30000-f7d37000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8642.log:f7d37000-f7d39000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8667.log:f7d3c000-f7d43000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid8667.log:f7d43000-f7d45000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid9957.log:f7d9a000-f7da1000 r-xp 00000000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    hs_err_pid9957.log:f7da1000-f7da3000 rwxp 00006000 08:01 422025 /emul/ia32-linux/lib/libnss_compat-2.3.6.so
    Sample stack trace:
    # An unexpected error has been detected by Java Runtime Environment:
    # SIGSEGV (0xb) at pc=0x67f69b57, pid=9123, tid=3902569360
    # Java VM: Java HotSpot(TM) Server VM (10.0-b22 mixed mode linux-x86)
    # Problematic frame:
    # C 0x67f69b57
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    --------------- T H R E A D ---------------
    Current thread (0x080a4c00): VMThread [stack: 0xe8947000,0xe89c8000] [id=9135]
    siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x67f69b57
    Registers:
    EAX=0x67f69b57, EBX=0xf7f62ff4, ECX=0x000e89c6, EDX=0x00000000
    ESP=0xe89c6934, EBP=0xe89c6968, ESI=0x080a4c00, EDI=0x080df118
    EIP=0x67f69b57, CR2=0x67f69b57, EFLAGS=0x00010203
    Top of Stack: (sp=0xe89c6934)
    0xe89c6934: e89c6a10 eabdb800 eaaea220 eabdb838
    0xe89c6944: 0003c586 000023af 0657221a 0805848c
    0xe89c6954: eaaea220 eabdb838 080df0d4 080a4c00
    0xe89c6964: 00000001 e89c6998 064e51cb 080df118
    0xe89c6974: 08058350 e89c6998 0629cb5e 08058450
    0xe89c6984: 0003c586 e89c69d8 f0c719a8 e89c6ae0
    0xe89c6994: 00000001 e89c69b8 064e526c 080df0d4
    0xe89c69a4: 080a4c00 00000000 064f6ddb 080df478
    Instructions: (pc=0x67f69b57)
    0x67f69b47:
    [error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb]
    Stack: [0xe8947000,0xe89c8000], sp=0xe89c6934, free space=510k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C 0x67f69b57
    V [libjvm.so+0x4e51cb]
    V [libjvm.so+0x4e526c]
    V [libjvm.so+0x4f6cd8]
    V [libjvm.so+0x34c60d]
    V [libjvm.so+0x4dbe4c]
    V [libjvm.so+0x31722e]
    V [libjvm.so+0x5b83cf]
    V [libjvm.so+0x5ba5bb]
    V [libjvm.so+0x55a59d]
    V [libjvm.so+0x322be7]
    V [libjvm.so+0x2ce43b]
    V [libjvm.so+0x3227f7]
    V [libjvm.so+0x294845]
    V [libjvm.so+0x322b8c]
    V [libjvm.so+0x5edede]
    V [libjvm.so+0x5fb0c7]
    V [libjvm.so+0x5fa6dc]
    V [libjvm.so+0x5fa8b1]
    V [libjvm.so+0x5fa48f]
    V [libjvm.so+0x4fe219]
    C [libpthread.so.0+0x5192]
    VM_Operation (0xe371ee1c): GenCollectForAllocation, mode: safepoint, requested by thread 0x08217000
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x082f6400 JavaThread "Thread_528" [_thread_blocked, id=12818, stack(0xddd8a000,0xddddb000)]
    0x080db800 JavaThread "Thread_2" [_thread_blocked, id=9178, stack(0xe8547000,0xe8598000)]
    0x080da400 JavaThread "Thread_1" [_thread_blocked, id=9177, stack(0xe8598000,0xe85e9000)]
    0x080d9800 JavaThread "Thread_0" [_thread_blocked, id=9176, stack(0xe85e9000,0xe863a000)]
    0x080c9800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=9162, stack(0xe86bb000,0xe870c000)]
    0x080c8400 JavaThread "CompilerThread1" daemon [_thread_blocked, id=9155, stack(0xe870c000,0xe878d000)]
    0x080bdc00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=9147, stack(0xe878d000,0xe880e000)]
    0x080bc800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=9146, stack(0xe880e000,0xe885f000)]
    0x080a9000 JavaThread "Finalizer" daemon [_thread_blocked, id=9137, stack(0xe88a5000,0xe88f6000)]
    0x080a8000 JavaThread "Reference Handler" daemon [_thread_blocked, id=9136, stack(0xe88f6000,0xe8947000)]
    0x08057800 JavaThread "main" [_thread_blocked, id=9126, stack(0xf7da4000,0xf7df5000)]
    Other Threads:
    =>0x080a4c00 VMThread [stack: 0xe8947000,0xe89c8000] [id=9135]
    0x080cb400 WatcherThread [stack: 0xe863a000,0xe86bb000] [id=9174]
    VM state:at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
    [0x08056388/0x080563b0] Threads_lock - owner thread: 0x080a4c00
    [0x08056848/0x08056860] Heap_lock - owner thread: 0x08217000
    Heap
    def new generation total 7296K, used 7273K [0xe8c40000, 0xe9420000, 0xe9a70000)
    eden space 6528K, 99% used [0xe8c40000, 0xe929c8f0, 0xe92a0000)
    from space 768K, 98% used [0xe92a0000, 0xe935dee8, 0xe9360000)
    to space 768K, 0% used [0xe9360000, 0xe9360068, 0xe9420000)
    tenured generation total 47472K, used 17838K [0xe9a70000, 0xec8cc000, 0xf0c40000)
    the space 47472K, 37% used [0xe9a70000, 0xeabdb838, 0xeabdba00, 0xec8cc000)
    compacting perm gen total 16384K, used 1648K [0xf0c40000, 0xf1c40000, 0xf4c40000)
    the space 16384K, 10% used [0xf0c40000, 0xf0ddc170, 0xf0ddc200, 0xf1c40000)
    No shared spaces configured.
    Dynamic libraries:
    06000000-0665d000 r-xp 00000000 08:02 543502 /usr/java/jdk1.6.0_06/jre/lib/i386/server/libjvm.so
    0665d000-066a1000 rwxp 0065c000 08:02 543502 /usr/java/jdk1.6.0_06/jre/lib/i386/server/libjvm.so
    066a1000-06ac3000 rwxp 066a1000 00:00 0
    08048000-08052000 r-xp 00000000 08:02 541414 /usr/java/jdk1.6.0_06/bin/java
    08052000-08053000 rwxp 00009000 08:02 541414 /usr/java/jdk1.6.0_06/bin/java
    08053000-083a8000 rwxp 08053000 00:00 0 [heap]
    ddd8a000-ddd8d000 ---p ddd8a000 00:00 0
    f7f87000-f7f88000 ---p f7f87000 00:00 0
    f7f88000-f7f89000 rwxp f7f88000 00:00 0
    f7f89000-f7fa3000 r-xp 00000000 08:02 1622023 /lib/ld-2.6.1.so
    f7fa3000-f7fa5000 rwxp 0001a000 08:02 1622023 /lib/ld-2.6.1.so
    fff5f000-fff68000 rwxp fff5f000 00:00 0 [stack]
    ffffe000-fffff000 r-xp ffffe000 00:00 0 [vdso]
    VM Arguments:
    jvm_args: -Xms32m -Xmx128m
    java_command: GCStress 2000 1048570
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin
    LD_LIBRARY_PATH=/usr/java/jdk1.6.0_06/jre/lib/i386/server:/usr/java/jdk1.6.0_06/jre/lib/i386:/usr/java/jdk1.6.0_06/jre/../lib/i386
    SHELL=/bin/bash
    HOSTTYPE=x86_64
    OSTYPE=linux
    MACHTYPE=x86_64-suse-linux
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x5edbc0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGBUS: [libjvm.so+0x5edbc0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGFPE: [libjvm.so+0x4fc630], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGPIPE: [libjvm.so+0x4fc630], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGXFSZ: [libjvm.so+0x4fc630], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGILL: [libjvm.so+0x4fc630], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x4fe670], sa_mask[0]=0x00000000, sa_flags=0x10000004
    SIGHUP: [libjvm.so+0x4fe410], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGINT: [libjvm.so+0x4fe410], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGTERM: [libjvm.so+0x4fe410], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGQUIT: [libjvm.so+0x4fe410], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    --------------- S Y S T E M ---------------
    OS:openSUSE 10.3 (X86-64)
    VERSION = 10.3
    uname:Linux 2.6.22.5-31-default #1 SMP 2007/09/21 22:29:00 UTC x86_64
    libc:glibc 2.6.1 NPTL 2.6.1
    rlimit: STACK 8192k, CORE 0k, NPROC 16384, NOFILE 8192, AS 3334080k
    load average:13.01 11.87 9.18
    CPU:total 1 (1 cores per cpu, 1 threads per core) family 15 model 4 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2, sse3
    Memory: 4k page, physical 2063116k(334428k free), swap 2104472k(2104472k free)
    vm_info: Java HotSpot(TM) Server VM (10.0-b22) for linux-x86 JRE (1.6.0_06-b02), built on Mar 25 2008 00:26:44 by "java_re" with gcc 3.2.1-7a (J2SE release)
    time: Thu May 15 13:26:54 2008
    elapsed time: 365 seconds

  • Regression results under linux

    Hi everybody,
    I ran the T2 regression under Linux and the tool ends correctly. The problem is that all tests gave result "Unknown".
    I ran the following command:
    sims -sys=cmp1 -group=cmp1_mini_T2 -nobuild -vcs_rel_name=vcs_build_2008_07_07_0
    and the results are
    <<snip>>
    Total Diags : 6
    Total Passed : 0
    Total Unknown: 6
    Total Unfini : 0
    Total Fail : 0
    Total Cycles : N/A
    Total Time : N/A
    Average C/S : N/A
    Do you have any suggestions? What means unknown, I can't find it in the OpenSPARCT2_DVGuide.pdf manual.
    thanks,
    pico

    Thanks for the quick response. I was hoping my problem was also the result of goldfinger, but given your description I don't believe it is (no "FATAL ERROR" anywhere in my logs). I'm actually running redhat enterprise so I don't think there should be redhat library issues either. However, I do think I am having 32bit/64bit compatibility issues with the pli libraries. Perhaps the following might help in diagnosing my problem
    1) running sims without "-vcs_full64" and a 32bit version of Vera I see the following error in my sims.log
    Program error in file ../symtype.c at line 407.
      Assertion failed:
      t != NULL && t->tycon == TYCON_OBJECTperforming a simple grep on "symtype.c" I found that it's only referenced in
    verif/env/common/pli/vera/loadpli/linux/libverapli.soand
    verif/env/common/pli/vera/loadpli/libverapli.so2) running sims with a amd64 version of Vera and using the "-vcs_full64" flag eliminates the error in 1) but results in the the following warnings in the compile.log file
    /usr/bin/ld: warning: i386 architecture of input file `<path>/opensparct2/verif/env/common/pli/global_chkr/linux/libglobal_chkr.a(global_chkr.o)' \
    is incompatible with i386:x86-64 output
    /usr/bin/ld: warning: i386 architecture of input file `<path>/opensparct2/verif/env/common/pli/socket/linux/libsocket_pli.a(socket.o)' \
    is incompatible with i386:x86-64 output
    /usr/bin/ld: warning: i386 architecture of input file `<path>/opensparct2/verif/env/common/pli/socket/linux/libsocket_pli.a(queue.o)' \
    is incompatible with i386:x86-64 output
    /usr/bin/ld: warning: i386 architecture of input file `<path>/opensparct2/verif/env/common/pli/monitor/linux/libmonitor_pli.a(monitor.o)' \
    is incompatible with i386:x86-64 output
    /usr/bin/ld: warning: i386 architecture of input file `<path>/opensparct2/verif/env/common/pli/monitor/linux/libmonitor_pli.a(hasher.o)' \
    is incompatible with i386:x86-64 output3) just out of curiosity I ran sims with the 64bit Vera and without "-vcs_full64". As expected I see a bunch of i386:x86-64 incompatible with i386 output warnings in the compile.log and no simv is built.
    For all scenarios, 1-3, I also see the warning
    /usr/bin/ld: warning: libstdc++.so.5, needed by <path>/rhel_5/vcs-2006.06-sp2/linux/lib/libvcsnew.so, \
    may conflict with libstdc++.so.6My best guess is that not all of the precompiled libraries that come bundled with the T2 were compiled for x86-64 and that is what's causing me problems. I tried to recompile the pli libraries using the makefile in /tools/pli but ran into some issues that I'm going to try and fix today. Any help would be greatly appreciated. Thanks!

  • Files under linux and windows

    Hi,
    I have a program that works under both windows and linux. I wanted to know what is the best way for the file paths I use.
    What is the difference between using "/" and "java.io.File.separator"?
    Any more info/tips on the difference between working under windows and linux will be great. I tried searching for it online but couldn't find anything useful.
    Thanks,
    Shaul

    BigDaddyLoveHandles wrote:
    I thought that if you used a '/' in a path string it was interpreted correctly, even in Windoze.Other platforms are available :-)
    I can't recall the details now, but we had an inexplicably-breaking build on Windows earlier this year for code that was fine under Linux, and tracked it back to the use of "/" rather than File.separator. It was an odd corner case which escapes me, but a lesson learnt nonetheless

  • Loss of keyboard focus in Java appl running under linux

    I have a small sample program that replicates my problem. When this program is run a window is created. If you select File->New another instance of the program window is created. Now if you try to go back and bring to front the first window, keyboard focus is not
    transferred when run under linux. You can only type in the second window. The expected behavior does happen in Windows.
    > uname -a
    Linux watson 2.6.20-1.2933.fc6 #1 SMP Mon Mar 19 11:38:26 EDT 2007 i686 i686 i386 GNU/Linux
    java -versionjava version "1.5.0_11"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
    javac -versionjavac 1.5.0_11
    import java.awt.event.*;
    import javax.swing.*;
    class SwingWindow extends JFrame {
        SwingWindow() {
         super("SwingWindow");
         JMenuBar menuBar = new JMenuBar();     
            JMenu fileMenu = new JMenu("File");
            JMenuItem newItem = new JMenuItem("New");
            newItem.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
              SwingWindow.createAndShowGUI();
         fileMenu.add(newItem);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);       
         JTextField text = new JTextField(200);
         getContentPane().add(text);
         pack();
         setSize(700, 275);
        public static void createAndShowGUI() {
            JFrame frame = new SwingWindow();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    You can implement the FocusListener interface. When
    the first JFrame gains focus, call
    text.requestFocusInWindow(). I hope this helps.The call requestFocusInWindow is not helping, perhaps even making it worse.
    The problem seems to be that I am in the situation where the call
    KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner()
    is returning the expected Component. The problem is that the KeyListener class that is registered with the Component is not being called when a key is being pressed.
    The issue is that I have a component that has the keyboard focus, but the KeyListener class
    is not responding.
    This seems to be a linux only problem which makes it only mysterious.

  • Cannot install JMF under Linux Mandrake 10

    I simply cannot install JMF under the Mandrake 10 Official Linux distribution. I downloaded the jmf-2_1_1e-linux-i586.bin file and tried to execute it as root. It unzipped some files then showed me an error message about AWT and GTK+. I found a hack consisting of modifying the .bin file to have the PATH variable point to SUN JDK, the error does not show up, but the installation still does not work. In fact, the installation works, but the Diagnostics applet keeps telling me than class files are not present. My Mozilla 1.6 Java plugin is working and displaying the applet. My JMF lib directory does not contain sound.jar, such jmf.jar. I set the CLASSPATH and LD_LIBRARY_PATH according to the readme.html file. I would like to know if it is a compatibility problem with Mandrake 10, the 2.6 kernel or if JMF just DO NO work under Linux. In the latter case, JMF is a violation to the Java portability philosophy and I would never use it on my own initiative, just if I were asked to.
    After the files are unzipped, I have the following warning and error messages.
    Warning:
    Name: HorScrollBar
    Class: XmScrollBar
    The specified scrollbar value is greater than the maximum
    scrollbar value minus the scrollbar slider size.
    JavaSound Capture Supported = true
    JavaSoundAuto: Committed ok
    java.lang.Error: Can't open video card 0
    java.lang.Error: Can't open video card 1
    java.lang.Error: Can't open video card 2
    java.lang.Error: Can't open video card 3
    java.lang.Error: Can't open video card 4
    java.lang.Error: Can't open video card 5
    java.lang.Error: Can't open video card 6
    java.lang.Error: Can't open video card 7
    java.lang.Error: Can't open video card 8
    java.lang.Error: Can't open video card 9
    Done.
    Even if I do not have a working video capture card (I have an ATI All-in-Wonder 128 but it is not working under 2.6 kernel), JMF should work because some people do not have a video capture card. I also tried with the cross-platform ZIP file, but this one does not contain sound.jar either and the Diagnostics applet keeps complaining about missing class files. I tried to search on the Web for solutions to this problem or for a way to change the CLASSPATH used by the Mozilla Java plug-in (if it uses a different CLASSPATH than the one from the environment variable), but nothing, nothing. Is there a distribution from which JMF would work better than Mandrake 10? Or can JMF work only under Microsoft Windows or Sun Solaris? I also tried Blackdown, but a README file directed me to the Sun's page, nothing to download here about JMF.

    well, your not the only one.
    I have it working in Debian, and JDS.(JMF is setup automatically in JDS).(2.6.6 kernel)
    I looked at the installation structure of JDS, and was able to duplicate what they did for Debian.
    Maybe it will work for Mandrake two??
    ok, all you have to do is copy or create soft links from your Mozilla directory, just like you did with the java plugin, and link to all the *.so files in JMF-2.1.1e/lib directory.
    Should work.
    I also read that not haveing the native files only matters if you are doing Capture. not play.
    to get your ATI All-in-Wonder 128 to work, make sure you install the correct driver, and have it working under linux, then try it in JMSTUDIO

  • Finding the multiple JRE installed path in Linux OS

    for my requirement on finding the JRE installaiton folder on windows and Linux machines , I can able to get it in windows but I am facing problem in getting the jre installed path from Linux machine. I am using Debian etch OS. Can anyone help me to find the installed path of JRE in Linux machine using a Java program. I need to find the multuiple JRE installed paths, i.e. my java program should find all the JRE installed paths and versions of the same.
    Thanks in advance.
    Edited by: VijayForumScreen on Jul 29, 2008 5:46 AM

    As per the terminal prompt its ok...but i need the java concept to retrieve the versions and installed paths of the all JRE.
    e.g;For current JRE we can get by,
    System.out.println(System.getProperty("java.version"));
    System.out.println(System.getProperty("java.home"));
    Output:
    1.5.0_10
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre
    If i installed 1.3 and 1.4 also.,
    How can i get installed paths and versions for all three 1.3,1.4 and 1.5 JRE's

  • How to output executable Bin file under linux from java

    Hi
    im beginner in java under linux and i want to out put my java programs to be bin files that can run
    if this not possilble
    how to run the output jar files with just double click ?
    does i have to run sh file that do the hob how?
    thanks in advance.

    say your main method (application's entry point) is located in a class com.my.Class,
    then first you create a text file (say, manifest.txt) that contains this line:
    Main-Class: com.my.Class
    [/code}
    and then you append this to the jar's manifest as such:
    jar cfm yourjarfile.jar manifest.txt [additional files you might want to add]
    for more info,
    http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Analog Triggering and Interrupt generation on the PCIe-6320 under Linux

    We would like to use the analog triggering functions of the PCIe-6320 under Linux to time tag external events.
    I have no experience with the MH DDK but have been told this is what we would need to implement the functions we want. We plan on using Fedora Linux and we are targetting kernel 2.6.31 with the PREEMPT_RT patch applied. We may consider slightly more recent kernel versions. The PREEMPT_RT patch is used to greatly improve determinism in the system and get real-time responses to some external events.
    Here is what we wish to do in more details:
    We wish to route at least two analog inputs to the comparator, then route the output of the comparator to a digital input which in turn would create a PCIe interrupt. The interrupt software handler would than time tag that event for our application purposes. We need the comparator threshold to be software programmable in level and slope. We are also interested in using the Watchdog Timer feature of the board.
    Our application is written in C/C++.
    Would the above be feasible? Please provide comments and instructions how we should address our requirement.
    Thanks!

    Patof wrote:
    I am not familiar with the MHDDK. I would like to have an idea of the effort required to implement the functions I have described using MHDDK on Linux. Like I mentionned, we plan on using Linux kernel 2.6.31 with the PREEMPT_RT patch. Could you provide comments on that matter? I need to evaluate the amount of time I will need to spend to deploy and use MHDDK for the PCIe-6320.
    There are two factors to consider when writing a driver for your specific application:
    Using the deterministic kernel API calls
    Writing to the device registers to
    Control the watchdog timer
    Configure the analog comparator
    Manage the analog subsystem state as trigger events occur
    Handle device interrupts
    The MHDDK for X Series offers the following behavior out-of-the-tarball:
    A Linux kernel module using the standanrd kernel and PCI subsystem calls
    Mapping device registers to user-mode for access
    Demonstrating/documenting how to
    Control the watchdog timer (dioex6.cpp)
    Manage the analog subsystem state as trigger events occur (aiex2.cpp, aiex4.cpp)
    Handle device interrupts (reference manual only)
    There are two notably missing pieces and one item to consider:
    Missing: deterministic kernel API calls. If you decide to use the nirlpk module, you would need to change it from the standard interfaces to the deterministic variants.
    Missing: configuring the analog comparator. You will need to implement this with additional insight from this discussion board.
    Consider: if your application requires device access from kernel-mode only, you would not be able to use the MHDDK's C++ classes that perform device programming but would need to implement register programming in C.
    To estimate the time for these three, here are my recommendations:
    Review the nirlpk.c source file to understand how device access and DMA buffers are implemented and mapped to the user-mode application.
    Beware that operation-specific programming help (as you would need for analog triggering) typically requires two weeks for a complete response.
    Review the ChipObjects in the MHDDK distribution to understand how register addresses, widths, and bit fields affect device programming.
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • How to use DAQ as a soundcard under linux

    Hi,
    My goal is to use a pci-4461 as a high accuracy replacement for a soundcard in a linux environment. The programming language should be C.
    I have already looked at the examples that come with the linux driver but my problem is how to exchange the audio data with other applications in real time.
    My other application is a softphone for IP-telephony that normally uses the /dev/dsp device under linux to exchange sound with the soundcard. (This can be changed to another device from within the softphone). Now, I want the softphone to read from and write to the DAQ instead of the soundcard. So the DAQ should be configured for continous analog input and output and give the data to the softphone in real time.
    Do you have any ideas how to do that with the nidaq-C-functions?
    Thank you for your help
    Fabian

    This example might help:
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=EE91CE2098BB42C1E0340003BA230ECF&p_...

  • Compile fail under linux ! oci.h: No such file or directory

    I want to transplant an Win32 OCI program to Linux.When i compile the program under Linux, the gcc returns the error information 'oci.h: No such file or directory '.
    Where can i find the OCI libs and includes under Linux/Unix?

    and I suggest you should use $ORACLE_HOME/rdbms/demo/demo_rdbms.mk to build oci applications. Instructions are there in the same file.

  • Too many resources used under Linux

    I have tested sun jvm under linux red-dat 6.2
    and 7.1 (listed by Sun as official platform supported)
    The JVM I test was from 1.3.0 to the 1.4.1
    I have written a simple application server that
    runs java application starting a new JVM.
    When the java application runs (with the -server or
    -hotspot option) I see that 10 java process are
    istantiated. (10 JVM)
    This is a real problem because for 4 users that runs 4
    applications there are 40 JVM running
    (each one allocates about 20 Mb of memory)
    and the system became very slow.
    With the -classic option the situation is better: only 1 JVM
    for application is started, (the application is the same, I
    have change only the -server option with -classic)
    but JVM seems to be less stable: I have a lot of segmentation
    fault errors. (with core dump)
    With the new distribution of Sun JVM (1.4.1) the -classic option
    is no longer supported.
    Does anyone knows if is there a way to have only one JVM
    for application? (-classic does not works well)
    Is there others JVM for linux more stable instead of the Sun one?
    PS: I have tested the same code under win/2000 using JVM 1.3.1_03
    and the -classic option. All goes well (the same application):
    I haver only 1 thread for application without jvm runtime error.
    Now my doubt is: does Sun belive in the Linux Word?
    JVM for Windows is much more stable!!!
    Thank you in advanced and best regards.

    I am assuming that you believe that there are 10 processes because that is what ps shows. However on Linux, each thread in a java program shows up in ps as a separate process. The memory for each "ps process" corresponding to a java thread is shared among all the threads of the JVM. Therefore if you see 10 processes with 20MB each you are not using 200MB, just 20.
    If you are running 4 JVMs then you would be using 40MB not 800 as shown in ps.
    I think Sun's JVM for linux is quite good (as I use it every day). If you need to run so many JVMs you should invest in more memory.
    BTW, How much memory is installed in your system?

Maybe you are looking for

  • I can no longer open safari!?!

    Hi everyone, My computer crashed today and now i can no longer open safari! A window pops up saying "Safari Web Browser has encountered a problem and needs to close. We are sorry for the inconvenience." And thats it, you can see more details but i do

  • JWS and DB Connections...

    Hi I have an java program that uses MySQL Database on Linux Server. I am using "org.gjt.mm.MySQL" JDBC driver. Everything is fine in JBuilder. But I have a problems with ClassFor name.....I've tryed : - this.getClass().getClassLoader().loadClass ("or

  • After ugrading to Firefox 4, all my bookmarks are now gone. Is there a way to get them back.

    Was using the latest version of Firefox. Had a ton of bookmarks. Upgraded to Firefox 4. The installation wizard lost all my book marks. Is there a way get my bookmarks back from the previous version of Firefox?

  • Syncing photos Question

    Trying to clean up my photos. I created a folder and put only the photos I want on my iPhone into it. I then connect my 4s to iTunes and go to the photos tab and choose sync selected folder and choose the folder. The problem is all of the photos were

  • Concat UDF question

    Hi all, I  have a requremnt in the map. Source looks like this, Description (Node) 1-many  >   It has 2 fields in it namely : 1.  Indicator(String) 0-1 2. Comment(String) 1 Now target looks like this ProductDescription(Node) 1-many  > it has just 1 n