Running JVM in Linux with execl

Why if I run JVM under Linux and with execl the first argument is lost?
For example if I want to run java -version I have to do:
execl("/usr/lib/java5/bin/java","nothing","-version");
If I do execl("/usr/lib/java5/bin/java","-version"); it doesn't works and appears the help message that appears when you are wrong with the parameters.
This is an innocent thing when you know it, but that has caused me a lot of headaches and debug time and now I'm curios about it ;)
PD: I use jdk-1_5_0_01 and Suse 9.1
A lot of thanks in advance,

/* a.c */
#include <stdio.h>
#include <stdlib.h>
int main() {
int r=execl("./b","nothing","-version",NULL);
printf("%d\n",r);
/* b.c */
#include <stdio.h>
int main(int argc,char *argv[]) {
int i;
        for(i=0;i<argc;i++) printf("%d %s\n",i,argv);
$ gcc a.c -o a
$ gcc b.c- o b
$ ./a
0 nothing
1 -version

Similar Messages

  • Can't run apps. in Linux with USB-6008

    I am using USB-6008 by installing nidaqmxbase-1.5.0 under RH 2.4-20 without any error.
    (I installed package with the device unplugged).
    I run /usr/local/natinst/nidaqmxbase/bin/lsdaq and get:
        National Instruments DAQ Devices
        Found the following DAQ Devices:
        NI USB-6008: "Dev1"    (USB0::0x3923::0x717A::00E1D95B::RAW)
    I run /usr/local/natinst/nidaqmxbase/examples/ai/acquire1Scan application using Dev1/ai0 and get:
        DAQmxBase Error: Physical channel specified does not exist on this device.
        Refer to the documentation for channels available on this device.
    I do see 2 drivers are loaded. They are nipalk and nikal. But I don't know what is the driver associated with Dev1.
    And I don't see any Dev1 node under /dev (assume it is a character driver).
    I need help.
    John

    John,
    When you install the USB-6008 in Linux you need to have the daqmxbase firmware
    loaded onto the device.  If this device was ever plugged into a windows
    machine it is likely that the daqmx firmware was loaded onto the device. 
    If the daqmx firmware is on the device the USB-6008 will install, however you
    will not be able to use the device.  In order to change the firmware back
    to daqmxbase you need to plug the USB-6008 back into a windows machine and
    install the daqmxbase firmware.  I have included a link below that walks
    you through this process.
    http://digital.ni.com/public.nsf/websearch/1448A8AC665EE0EA8625703F004A4410?OpenDocument
    Regards,
    Jesse O
    Application Engineering
    National Instruments
    Jesse O. | National Instruments R&D

  • Considering buying MacBook, wish to run windows and Linux with VMware

    Considerations:
    Which MacBook pro, do they all support virtualization? I7 MacBook pro Retina display was the device I was considering.
    What are the other considerations, storage capacity, HD or flash, or simply size?
    The operating system I assume would be mountain lion with the mac, I assume thats not an issue.
    VMware was the virtualiszation software I was considerring, any others.
    Just basic starting information needed, in order to even see if it's possible and which path to take.
    Walter

    Yes. And with these modern multicore processors, you can dedicate a few cores to the guest OS to improve performance. One thing you must have is lots of RAM; enough to keep both the OS X host and all the guest systems happy. Since a new Mac will sport Mountain Lion inevitably, 8GB is a minimum choice. Remember you can upgrade the RAM (and drive) with third party alternatives far cheaper than what Apple sticks you for it.
    Virtualization options are Parallels Desktop (most expensive), VMware Fusion (intermediate) or Oracle VirtualBox (free). The two commercial options are naturally more polished than the freebie, but it is fast catching up.

  • How to run AIR on linux with no gui, no console?

    Folks,
    Has anyone had success running an AIR application from the command line in the background without a GUI?  Is setting WindowApplication.visible=false, sufficient?  Required?  Thanks!

    To run an Air app you need to install Air installer.
    One of the requirements of Air Installer is either GNOME or KDE.
    So I think it will not run.
    More requirements here:
         http://www.adobe.com/support/documentation/en/air/1_5_1/releasenotes_developers.html#sysre qs
    HTH.

  • 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

  • May LV for Linux run in embeded linux system with ARM9 ?

    Hello All,
    May LV for Linux run in embeded linux system with ARM9 ?
    Tks and best regards!
     Bright

    No, it will only run on Intel compatible processors.
    You'll need LV Microprocessor SDK for that (AKA LVEmbedded). But you'll lose
    the MMI. And you need to build toolchains yourself (although there is a
    cygwin example shipped, and converting it to any gcc toolchain is not that
    difficult).
    There is a special LV MSDK for ARM processors, but not for all of them.
    Regards,
    Wiebe.

  • HOW TO run SAPGUI into LINUX

    HOW TO run SAPGUI into LINUX
    Hi all,
    I make this document for people who need install SAPGUI into Linux.
    1)
    Minimal system requeriments.
    Linux
    Hardware:
    CPU: Intel PentiumIII with 800 MHz
    RAM: 256MB
    Software:
    OS: SuSE Linux 9.3 - 10.1, Red Hat Enterprise Linux 3 and 4
    JVM: Sun Java Runtime Evironment 1.4.2 (32-bit) or 5.0 (32-bit) including Java Plugin
    please see http://java.sun.com/j2se/1.4.2/install-linux.html and http://java.sun.com/j2se/1.4.2/docs/...ocale.doc.html resp. http://java.sun.com/j2se/1.5.0/install-linux.html and http://java.sun.com/j2se/1.5.0/docs/...ocale.doc.html for details
    2)
    Download SAPGUI from:
    ftp://ftp.sap.com/pub/sapgui/java/
    (anonymous login)
    https://websmp201.sap-ag.de/sapgui-java
    (OSS user and pass)
    3)
    At /java folder in ftp select:
    File: PlatinGUI-Linux-700.jar 37926 KB 11/07/06 13:58:00
    (note: maybe a new version is available)
    4)
    At downloaded folder, execute
    java -jar PlatinGUI-Linux-700.jar
    5) Executing SAPGUI
    A) Guilogon:
    ~/SAPClients/SAPGUI7.00/bin$ ./guilogon
    To create servers, touch at new and go to "advanced".
    -- tip “use expert configuration”
    Example:
    For server 10.1.1.6 with system number 01:
    conn=/H/10.1.1.6/S/3201
    B) Command line
    For server 10.1.1.6 with system number 01:
    ~/SAPClients/SAPGUI7.00/bin$ ./sapgui /H/10.1.1.6/S/3201
    Hope it helps, Goodbye!

    Hi,
    I'm trying to use the SAPgui for Java on Ubuntu 6.06 and I have problems with that. The SAPgui connects to the SAP system problemless.
    After couple of minutes the SAPgui for Java always hangs with these messages in terminal:
    ERROR #############################
    17.08. 11:13:01.700 ERROR: JniAgComAdaptor.write failed
    ERROR #############################
    ERROR #############################
    17.08. 11:13:01.714 ERROR: GuiNiWriter: write failed
    ERROR #############################
    I'm connecting to SAP Netweaver 04 running on the same computer. I have also tried different versions of Java 1.4, 1.5 and the problem still persists.
    From other computers in network the SAPgui for Java runs perfectly against the same SAP system, running on the same Java version as before, on Ubuntu 6.06 or Fedora Core 5 whatever, it runs without any hassles.
    I haven't found any remarks on this error on Google, neither on SAP OSS.
    Do you think I can raise a question to OSS? I don't think there are some restrictions for SAPGUI for Java regarding use of Linux distribution.

  • Oracle10g Installation problem on Linux with DHCP IP

    Hi,
    I am new to Oracle Products, I have tried to install Oracle 10G on Linux with DHCP IP.
    I got the following warning while installing even though I have loopback interface configured.
    Checking Network Configuration requirements ...
    Check complete. The overall result of this check is: Failed <<<<
    Problem: The install has detected that the primary IP address of the system is DHCP-assigned.
    Recommendation: Oracle supports installations on systems with DHCP-assigned public IP addresses. However, the primary network interface on the system should be configured with a static IP address in order for the Oracle Software to function properly. See the Installation Guide for more details on installing the software on systems configured with DHCP.
    Please help me in resolving this problem or Can I ignore this message?
    My Server Configurations:
    [root@SQAESMRH5 Oracle_Install_Errors]# ifconfig
    eth0 Link encap:Ethernet HWaddr 00:12:3F:79:FA:2C
    inet addr:10.10.121.61 Bcast:10.10.121.2 Mask:255.255.255.0
    inet6 addr: fe80::212:3fff:fe79:fa2c/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:20751998 errors:0 dropped:0 overruns:0 frame:0
    TX packets:19278549 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:2150795393 (2.0 GiB) TX bytes:438232502 (417.9 MiB)
    Interrupt:177
    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:12383146 errors:0 dropped:0 overruns:0 frame:0
    TX packets:12383146 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1965045834 (1.8 GiB) TX bytes:1965045834 (1.8 GiB)
    [root@SQAESMRH5 Oracle_Install_Errors]# cat /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    #::1 localhost6.localdomain6 localhost6
    127.0.0.1 localhost.localdomain localhost
    #::1 localhost6.localdomain6 localhost6
    [root@SQAESMRH5 Oracle_Install_Errors]#

    This warning means it is not recommended to install Oracle 10g on a DHCP assigned IP address. It could work, but you won't be able to configure Enterprise Manager, since this tool requires a fixed IP address. If possible, have the IP address fixed.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Replacing linux with os 10.3

    I have a second hand g5 iMac that was surplussed by a local university. It is running yellow dog linux 6.1. I have neither the time nor inclination to figure out how to get things done in linux, I just need a family computer. I purchased os 10.3 to replace the linux os, but can't figure out how to do it. I'm more familiar with PCs. I tried holding down the option key on booting. I got a screen showing yld in one box and the install disc in a second box with a button showing a right arrow and a second button showing (I think) a refresh curved arrow. I selected the install disc and clicked the right arrow. At that point I got a grey screen with a circle/slash and nothing further happened. Help!

    Welcome to the Apple Discussions.
    To do an install, start the machine while holding the C key down until after the tone. You will them be started on the install disk...by the way, this is a full retail version; disk with a black face and large grey or silver X on it? If a grey disk, you can't use it unless it was for that machine to begin with.
    Once started on the disk, select the language if it asks, then just proceed with the installation process. It may want to erase the HD since it was setup with Linux.
    If you have more questions, just ask away.

  • Run SGEN in linux while Importing transports from AIX app serevrs

    Hi
    We have multiple AIX and Linux app servers for SAP NW 2004s/SCM 5.0 systems. We completed SGEN in AIX app servers. We need to import more than 300 transports. Can we run SGEN on Linux app servers (we will remove LINUX app servers from SMLG to prevent user logon from LINUX app servers) while we importing transports from AIX app servers? Will it be any impact with REPOSRC/REPOLOAD or Object locking?
    Thanks
    Dilip

    Yes We do run SGEN both servers. and it takes double the time. My question is can we run SGEN on Linux while importing transports using AIX app servers. So this way we can gain sometime durinng our Mock Cutover timeline.

  • Installing  weblogic plugin in apache running on RedHat Linux WS4

    I want to install weblogic plugin in apache running on redhat Linux WS4. I have read the documentation. In my local weblogic,under this directory C:\bea81SP4\weblogic81\server\lib\linux
    I see the following three folders
    a) i686
    b) ia64
    c) s390.
    I dont know which folder to choose. Please advise.

    Hi,
    according to your processer you have to chose mod_ ..so file
    if you got error with sp4 plug in file use the plug in file from the another version
    plug in files are compatable
    Regards,
    Prasanna Yalam

  • Tuxedo 8.1 running on encrypted linux kernel

    Hi,
    Is anyone try to run Tuxedo 8.1 on Redhat linux kernel version 2.4.22 or above with encryption?
    Thanks.
    Thomas Gan

    I've had success with the RedHat AS3.0 (Pentium) version running on SuSe Linux 9.1 both 32bit and x86_64 builds

  • Compare Linux with Solaris

    We have tested the I/O performance on Intel-Solaris 7.0 and Intel-RedHat Linux.
    We found that Intel-Linux has much better performance than Intel-Solaris.
    Now, we are thinking to install Oracle 8i on Intel-Linux.
    However, before we make this decision, we would like to hear more opinions about
    the advantages and disadvantages of running Oracle on these two different
    operating systems. We'll appreciate, if you can give me your opinions.
    Thanks
    Thomas
    null

    This from experience of running large-db ecommerce site on intel linux with redhat 6.1, oracle 805 and 8i, with some java functions, intermedia, time-series module, 4 different servers on aolserver 2.33 and aolserver 3.0 on 1 machine: it's stable.
    I never had a crash, and no locking or restarting due to either aolserver or oracle.
    With a few minor modifications in linux to support some enterprise functions (raw devices, async io) linux on intel with oracle is almost ready to kick sun's ass. (at least on the 1 to 8 cpu server market)

  • Running java in linux script

    Suppose to package all necessary *.class in example.jar in following way,
    bin.start.class
    business.bus.class
    and the class file that contain main is bin.start.class.
    There is no problem to run following under linux shell prompt. java VM is under PATH searching path. i.e.
    $java -classpath example.jar bin.start
    However, there is some problem to run a script which contains 'java -classpath example.jar bin.start' under linux shell prompt.
    May I have any clue to identify this problem?
    Thanks in advance.

    For case 1: Does any case work? When I see "[un]able to locate the main method" then I think that that the class was found but that the main method is not declared properly.
    Of course, main must be declared with exactly these keywords:
    static public void main( String arg[]) {
    ...For case 2: you still have some kind of classpath problem.
    If your script really has the line
    java -classpath example.jar bin.start
    then I still think your current working directory at the time that this line is run not that same directory as where the jar file is.
    If you have JAVA_HOME defined, you might want to try:
    pwd
    $JAVA_HOME/bin/java -classpath example.jar bin.start
    Another suggestion: If your $PATH variable is long, try to shorten it to a short list of directories. You can test with just /bin:/usr/bin .
    Also, is your shell Bash or C-shell? Is your script Bourne shell (/bin/sh) or Bourne?

  • JMenuBar display quirks with some window managers on Linux with Java 6

    When I run this code on Windows with Java 5 or Java 6, it works fine.
    When on Linux with Java 5, it works fine.
    When on Linux with Java 6 in KDE, it works fine.
    When on Linux with Java 6 with twm or e17, the JMenu shows when I click on the JMenuBar, but goes away as soon as I release the mouse button. If I manually move or resize the window, it then works fine.
    If I remove setLocationByPlatform(true), the menu bar works, but it does not position the window by platform, which is the desired behavior.
    Am I doing something wrong, is there something wrong with both twm and e17, or is this a bug?
    import java.awt.Dimension;
    import java.awt.Label;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JMenuBar;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.WindowConstants;
    public class Test extends JFrame {
        public Test() {
            super();
            setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE );
            getContentPane().add( new Label( "Hello World" ) );
            JMenuBar mainMenu = new JMenuBar();
            setJMenuBar( mainMenu );
            JMenu helpMenu = new JMenu();
            mainMenu.add( helpMenu );
            helpMenu.setMnemonic( 'H' );
            helpMenu.setText( "Help" );
            JMenuItem help_about = new JMenuItem();
            helpMenu.add( help_about );
            help_about.setMnemonic( 'A' );
            help_about.setText( "About" );
            help_about.addActionListener(
                new ActionListener() {
                    public void actionPerformed( ActionEvent evt ) {
                        System.out.println( "HELP!" );
            pack();
            setLocationByPlatform( true );
            setVisible( true );
        public static void main( String[] args )
            throws Exception {
            java.awt.EventQueue.invokeLater(
                new Runnable() {
                    public void run() {
                        Test test = new Test();
    }

    In 10.1.3, there's an option to disable the splash screen on the Environment Page in preferences (although, of course, it's not much use if you never get to the main window because of the dialog popping up behind the splash screen... :) )
    The bug with the dialog appearing behind the splashscreen is fixed in the upcoming 11g release. FWIW, it's a problem that appears to be unique to X-based systems, where for some reason the splashscreen window ends up with some super-ueber topmost property that forces all other windows to go behind it.
    There's also a command line flag to suppress the splashscreen in 11g.
    Thanks,
    Brian

Maybe you are looking for

  • Problem while posting to accounts.posting period  002 2010 not open

    Hi experts, Im facing problem while posting to accounting. I ran the live payroll run and  while posting im got the incorrect document. System is showing the error message that  ""Posting period 002 2010 is not open""" How we have to open the periods

  • Last PO Price not picking up

    Hi experts, In one of my clients, the Price from the Last P.O for all combination of Vendor/Material/Plant is not picking up. This has happened 15 days ago. I couldnt find any changes. I checked the InfoRecord, the info update tick in PO, the User pr

  • AE 5.2 and CC 5.2

    Hello, What happens when an SOD check is run in Access Enforcer for a request that contain role in AE but that doesn't appear in Compliance Calibrator ? I'm thinking AE will not run Sod for that particular role..any suggestions pls..

  • S650 Duplicate Messages

    Hi, I need help. I just bought S650 yesterday. I downloaded Go SMS, and every time I receive sms the messages are automatically in duplicate. I uninstalled GO SMS a couple of times and the messages received are as usual - just one. 1. I want to make

  • Firewall Port Site Definition Globally Changing

    We are using Dreamwaver MX 2004 Educational Edition. We have several Managed Sites configured for secure FTP on firewall port 21. We have added a new site but it uses port 1021. When we configured that site we were able to connect with no probelm. Th