Launching Browser from Java when Browser URL is very  long

Hi,
I am trying to launch a browser from Java.
I am doing the following.
String command = "cmd" + "/c" + "start" + " browserURL";
Process p = Runtime.getRuntime()exec(command);
Note: My browserURL is very long.
Now the browser is invoked. But the URL shown is incomplete and hence
browser is unable to open the required application.
Can someone help me in this.
One way is to increase the buffer size on the command prompt?
Is there any java command for this?
Is there any other way to solve this issue.
Thanks,
AR

this is my second time posting this, take note of it. I can't remember where i got it from, but credits go to the person that wrote it. It has helped me out thousands of times!!!
to use, compile, then call from your program:
org.newio.utils.BrowserLauncher.openURL("your url here")dfwtc
package org.newio.utils;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.*;
public class BrowserLauncher
    private static int jvm;
    private static Object browser;
    private static boolean loadedWithoutErrors;
    private static Class mrjFileUtilsClass;
    private static Class mrjOSTypeClass;
    private static Class macOSErrorClass;
    private static Class aeDescClass;
    private static Constructor aeTargetConstructor;
    private static Constructor appleEventConstructor;
    private static Constructor aeDescConstructor;
    private static Method findFolder;
    private static Method getFileType;
    private static Method makeOSType;
    private static Method putParameter;
    private static Method sendNoReply;
    private static Object kSystemFolderType;
    private static Integer keyDirectObject;
    private static Integer kAutoGenerateReturnID;
    private static Integer kAnyTransactionID;
    private static final int MRJ_2_0 = 0;
    private static final int MRJ_2_1 = 1;
    private static final int WINDOWS_NT = 2;
    private static final int WINDOWS_9x = 3;
    private static final int OTHER = -1;
    private static final String FINDER_TYPE = "FNDR";
    private static final String FINDER_CREATOR = "MACS";
    private static final String GURL_EVENT = "GURL";
    private static final String FIRST_WINDOWS_PARAMETER = "/c";
    private static final String SECOND_WINDOWS_PARAMETER = "start";
    private static final String NETSCAPE_OPEN_PARAMETER_START = " -remote 'openURL(";
    private static final String NETSCAPE_OPEN_PARAMETER_END = ")'";
    private static String errorMessage;
    private BrowserLauncher()
    private static boolean loadClasses()
        switch(jvm)
        default:
            break;
        case 0: // '\0'
            try
                Class aeTargetClass = Class.forName("com.apple.MacOS.AETarget");
                macOSErrorClass = Class.forName("com.apple.MacOS.MacOSError");
                Class osUtilsClass = Class.forName("com.apple.MacOS.OSUtils");
                Class appleEventClass = Class.forName("com.apple.MacOS.AppleEvent");
                Class aeClass = Class.forName("com.apple.MacOS.ae");
                aeDescClass = Class.forName("com.apple.MacOS.AEDesc");
                aeTargetConstructor = aeTargetClass.getDeclaredConstructor(new Class[] {
                    Integer.TYPE
                appleEventConstructor = appleEventClass.getDeclaredConstructor(new Class[] {
                    Integer.TYPE, Integer.TYPE, aeTargetClass, Integer.TYPE, Integer.TYPE
                aeDescConstructor = aeDescClass.getDeclaredConstructor(new Class[] {
                    java.lang.String.class
                makeOSType = osUtilsClass.getDeclaredMethod("makeOSType", new Class[] {
                    java.lang.String.class
                putParameter = appleEventClass.getDeclaredMethod("putParameter", new Class[] {
                    Integer.TYPE, aeDescClass
                sendNoReply = appleEventClass.getDeclaredMethod("sendNoReply", new Class[0]);
                Field keyDirectObjectField = aeClass.getDeclaredField("keyDirectObject");
                keyDirectObject = (Integer)keyDirectObjectField.get(null);
                Field autoGenerateReturnIDField = appleEventClass.getDeclaredField("kAutoGenerateReturnID");
                kAutoGenerateReturnID = (Integer)autoGenerateReturnIDField.get(null);
                Field anyTransactionIDField = appleEventClass.getDeclaredField("kAnyTransactionID");
                kAnyTransactionID = (Integer)anyTransactionIDField.get(null);
                break;
            catch(ClassNotFoundException cnfe)
                errorMessage = cnfe.getMessage();
                return false;
            catch(NoSuchMethodException nsme)
                errorMessage = nsme.getMessage();
                return false;
            catch(NoSuchFieldException nsfe)
                errorMessage = nsfe.getMessage();
                return false;
            catch(IllegalAccessException iae)
                errorMessage = iae.getMessage();
            return false;
        case 1: // '\001'
            try
                mrjFileUtilsClass = Class.forName("com.apple.mrj.MRJFileUtils");
                mrjOSTypeClass = Class.forName("com.apple.mrj.MRJOSType");
                Field systemFolderField = mrjFileUtilsClass.getDeclaredField("kSystemFolderType");
                kSystemFolderType = systemFolderField.get(null);
                findFolder = mrjFileUtilsClass.getDeclaredMethod("findFolder", new Class[] {
                    mrjOSTypeClass
                getFileType = mrjFileUtilsClass.getDeclaredMethod("getFileType", new Class[] {
                    java.io.File.class
                break;
            catch(ClassNotFoundException cnfe)
                errorMessage = cnfe.getMessage();
                return false;
            catch(NoSuchFieldException nsfe)
                errorMessage = nsfe.getMessage();
                return false;
            catch(NoSuchMethodException nsme)
                errorMessage = nsme.getMessage();
                return false;
            catch(SecurityException se)
                errorMessage = se.getMessage();
                return false;
            catch(IllegalAccessException iae)
                errorMessage = iae.getMessage();
            return false;
        return true;
    private static Object locateBrowser()
        if(browser != null)
            return browser;
        switch(jvm)
        case 0: // '\0'
            try
                Integer finderCreatorCode = (Integer)makeOSType.invoke(null, new Object[] {
                    "MACS"
                Object aeTarget = aeTargetConstructor.newInstance(new Object[] {
                    finderCreatorCode
                Integer gurlType = (Integer)makeOSType.invoke(null, new Object[] {
                    "GURL"
                Object appleEvent = appleEventConstructor.newInstance(new Object[] {
                    gurlType, gurlType, aeTarget, kAutoGenerateReturnID, kAnyTransactionID
                return appleEvent;
            catch(IllegalAccessException iae)
                browser = null;
                errorMessage = iae.getMessage();
                return browser;
            catch(InstantiationException ie)
                browser = null;
                errorMessage = ie.getMessage();
                return browser;
            catch(InvocationTargetException ite)
                browser = null;
                errorMessage = ite.getMessage();
                return browser;
        case 1: // '\001'
            File systemFolder;
            try
                systemFolder = (File)findFolder.invoke(null, new Object[] {
                    kSystemFolderType
            catch(IllegalArgumentException iare)
                browser = null;
                errorMessage = iare.getMessage();
                return browser;
            catch(IllegalAccessException iae)
                browser = null;
                errorMessage = iae.getMessage();
                return browser;
            catch(InvocationTargetException ite)
                browser = null;
                errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage();
                return browser;
            String systemFolderFiles[] = systemFolder.list();
            for(int i = 0; i < systemFolderFiles.length; i++)
                try
                    File file = new File(systemFolder, systemFolderFiles);
if(file.isFile())
Object fileType = getFileType.invoke(null, new Object[] {
file
if("FNDR".equals(fileType.toString()))
browser = file.toString();
return browser;
catch(IllegalArgumentException iare)
browser = browser;
errorMessage = iare.getMessage();
return null;
catch(IllegalAccessException iae)
browser = null;
errorMessage = iae.getMessage();
return browser;
catch(InvocationTargetException ite)
browser = null;
errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage();
return browser;
browser = null;
break;
case 2: // '\002'
browser = "cmd.exe";
break;
case 3: // '\003'
browser = "command.com";
break;
case -1:
default:
browser = "netscape";
break;
return browser;
public static void openURL(String url)
throws IOException
if(!loadedWithoutErrors)
throw new IOException("Exception in finding browser: " + errorMessage);
Object browser = locateBrowser();
if(browser == null)
throw new IOException("Unable to locate browser: " + errorMessage);
switch(jvm)
case 0: // '\0'
Object aeDesc = null;
try
try
aeDesc = aeDescConstructor.newInstance(new Object[] {
url
putParameter.invoke(browser, new Object[] {
keyDirectObject, aeDesc
sendNoReply.invoke(browser, new Object[0]);
catch(InvocationTargetException ite)
throw new IOException("InvocationTargetException while creating AEDesc: " + ite.getMessage());
catch(IllegalAccessException iae)
throw new IOException("IllegalAccessException while building AppleEvent: " + iae.getMessage());
catch(InstantiationException ie)
throw new IOException("InstantiationException while creating AEDesc: " + ie.getMessage());
break;
finally
aeDesc = null;
browser = null;
case 1: // '\001'
Runtime.getRuntime().exec(new String[] {
(String)browser, url
break;
case 2: // '\002'
case 3: // '\003'
Runtime.getRuntime().exec(new String[] {
(String)browser, "/c", "start", url
break;
case -1:
Process process = Runtime.getRuntime().exec((String)browser + " -remote 'openURL(" + url + ")'");
try
int exitCode = process.waitFor();
if(exitCode != 0)
Runtime.getRuntime().exec(new String[] {
(String)browser, url
catch(InterruptedException ie)
throw new IOException("InterruptedException while launching browser: " + ie.getMessage());
break;
default:
Runtime.getRuntime().exec(new String[] {
(String)browser, url
break;
static
loadedWithoutErrors = true;
String osName = System.getProperty("os.name");
if("Mac OS".equals(osName))
String mrjVersion = System.getProperty("mrj.version");
String majorMRJVersion = mrjVersion.substring(0, 3);
try
double version = Double.valueOf(majorMRJVersion).doubleValue();
if(version == 2D)
jvm = 0;
} else
if(version >= 2.1000000000000001D)
jvm = 1;
} else
loadedWithoutErrors = false;
errorMessage = "Unsupported MRJ version: " + version;
catch(NumberFormatException numberformatexception)
loadedWithoutErrors = false;
errorMessage = "Invalid MRJ version: " + mrjVersion;
} else
if(osName.startsWith("Windows"))
if(osName.indexOf("9") != -1)
jvm = 3;
} else
jvm = 2;
} else
jvm = -1;
if(loadedWithoutErrors)
loadedWithoutErrors = loadClasses();
suck my balls

Similar Messages

  • Launching applications from java code

    I have found a solution to launch applications from java.I thought this will be useful for programmers who want to open a
    1. Browser
    2. Player
    3. Files etc.
    There are 2 solutions :
    I)To use a known application :
    eg: to open windows media player
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1] = "/C";
    cmd[2] = "START MPLAYER2.exe "+mediaURL+" /PLAY /CLOSE /FULLSCREEN";
    //eg: mediaURL = "\"D:/project/songs/track1.mp3\""
    // /PLAY /CLOSE /FULLSCREEN this option can be used only for windows media player
    // for any other application use cmd[2] as START apl.exe //apl can be any windows application
    Process p = Runtime.getRuntime().exec(cmd);
    II) To use a default application:
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
    // url can be any url
    ref: [http://forums.sun.com/thread.jspa?threadID=5203313|http://forums.sun.com/thread.jspa?threadID=5203313]
    [http://www.ericphelps.com/batch/rundll/|http://www.ericphelps.com/batch/rundll/]
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????

    To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
    And make up your mind what file type you're having a problem with. Maybe .asx doesn't have a file association on your computer.
    This works just fine for .m3u:import java.awt.Desktop;
    import java.io.File;
    import java.io.IOException;
    public class Playlist {
       public static void main(String[] args) {
          try {
             Desktop.getDesktop().
                   open(new File("E:/Music/Playlists/test.m3u"));
          } catch (IOException ex) {
             ex.printStackTrace();
    }db
    edit Did you try searching the net for the error you got? ("Invalid menu handle")
    Edited by: Darryl.Burke

  • Acrobat Pro 9 for mac won't launch, reloaded from disk when hard drive needed to be replace. It's in applications folder but there is an X on the Acrobat Reinstall icon. What should I do.

    Acrobat Pro 9 for mac won't launch, reloaded from disk when hard drive needed to be replace. It's in applications folder but there is an X on the Acrobat Reinstall icon. What should I do.

    Hi Janice,
    What version of Mac OS are you using?
    Adobe does not recommend migrating the software from one disk to the other.
    Please run the setup file for Acrobat and reinstall the software. You might want to delete the existing version of Acrobat installed before reinstalling it.
    Regards,
    Rave

  • Launching IE from Java

    Hi,
    My requirement is as follows:
    I must be able to launch Internet explorer from Java. Also i must be able to open a pdf file inside it (embedded inside IE i.e. acrobat reader inside IE).
    I have tried using OleControlSite object, but does not work ( i mean it does not launch IE). I have also tried using exec. Here, how do i open ? What are the parameters that need to be passed to exec? i have tried the following code.....
    String WIN_PATH = "rundll32";
    String WIN_FLAG = "url.dll,FileProtocolHandler";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + "c:\\NYSE Glossary.pdf";
    try {
    p = Runtime.getRuntime().exec(cmd);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    This piece of code opens the pdf file in acrobat reader(stand-alone). But i want the file to be open inside IE(acrobat embedded inside IE).
    Can anyone suggest me a solution?
    Thanks and Regards,
    Kris

    i have done the same thing.. it just opens the pdfin
    acrobat reader.. not as part of IEThat has nothing to do with the code... you need to
    install Acrobat plugin in IE. :)Annie. Have you changed login?

  • TDMS Shell - DB Export from source/sender system taking a VERY long time

    We're trying to build a TDMS Receiver system using the TDMS Shell technique. We've run into a situation wherein the initial  DB Export from source/sender system is taking a VERY long time.
    We are on ECC 6.0, running on AIX 6.1 and DB UDB v9.7. We're executing the DB export from sapinst, per instructions. Our DB export parallelizes, then the parallel processes one by one whittle away to just one remaining, and there we find out that the export is at that point single-threaded, and exporting table BSIS.
    BSIS is an FI transactional data table. We're wondering why is the DB export trying to get BSIS and its contents out??? Isn't the DB export in TDMS Shell technique only supposed to get SAP essential only config and master data, and NOT transactional data?
    Our BSIS table is nearly 700 GB in size by itself.  That export has been running for nearly a week now, with no end in site.
    What are we doing wrong? We suspect we may have missed something, but really don't think we do. We also suspect that the EXCLUSION table in the TDMS Shell technique may be the KEY to this whole thing. It's supposed to automatically exclude very large tables, but in this case, it most certainly missed out in excluding BSIS for some reason.
    Anyway, we're probably going to fire up an OSS Message with SAP Support to help us address this perplexing issue. Just thought we'd throw it out there to the board to see if anyone else somewhere has run into similar circumstances and challenges.  In the meantime, any feedback and/or advice would be dearly appreciated. Cheers,

    Hello
    Dont be bothered by the other TPL file DDLDB6_LRG.TPL, we are only concerned with DDLDB6.TPl.
    Answer following questions to help me analyze the situation -
    1) What is the current size of export dump
    2) Since when is the exports running
    3) What is the size of the source DB? Do you have huge amount of custom developments?
    4) Did you try to use table splitting?
    5) Do you doubt that there may be other transaction tables (like BSIS) which have been exported completely?
    6) Did you update the SAP Kernel of your source system to latest version before starting the Shell package?
    7) Were the DB statistics update during the shell or were they already updated before starting Shell?
    8) Is your system a distributed system i.e. Central instance and Database instance are on different application servers?

  • Stop gnome panel launcher icons from scaling when resizing the panel

    hi guys!
    ive been trying to customize my gnome de and cant find the answer to this. i want to have a thick panel say around 36px with a large main menu icon and 22x22 launcher icons. i tried checking gconf-editor and dont see any option to set this. when i resize the panel to 36 px, the launcher icons follow the size of the panel. i want them to stay at 22x22 even when the panel is resized to 36 px.
    below is a screenshot of what im talking about.
    please let me know what you think! many thanks!
    josh

    hey droog!
    thanks for your reply! tried that and it didnt work. i tried this: 
    gtk-icon-sizes = "panel=16,16:gtk-large-toolbar=16,16:gtk-small-toolbar=16,16:gtk-button=16,16"
    it did change the icons in the menu bar. and the icons in the notification area. but it did not change the custom launcher icons...
    do you know if they have a howto for this?

  • How to delete photos from iPad when original pics are no longer on computer

    Hi
    I need to clear photos from my iPad that were synced from my computer some time agi.
    Since sycing those pics from the pc to the ipad, I cleared up my pc and backed up the photos onto discs.
    How do I now delete those pics from the iPad, as the the images cant be selected and resynced from the pc anymore?
    Please help.
    Thanks
    Angela

    If you create an empty folder on your computer and you sync that folder as your photos folder, that will erase the photos from the iPad when you sync. Or you can unselect the Sync Photos From heading in the iTunes window and then sync to remove the photos.

  • For the last week while using iTunes(Windows 7) i have not been able to get the names of songs from CDDB when importing CDs. Very frustrating! Can anyone help me out?

    CDDB in itunes is not bringing up the name of songs on CDs when importing into itunes. This has been going on for a couple of weeks. Any help?

    I have, a couple different pairs, unfortunately, and still no change. TBH, the headphones don't bug me nearly as bad as the fact that I can't plug my iPod into a radio or speaker with an audio cable and hear my latest purchases. Drives me crazy that I can't listen to my tunes!    

  • Firefox becomes unresponsive (has timeout error) when trying to print very long webpages (e.g. 100 pages).

    I need to print off one long webpage containing a whole load of customer invoices. For anything up to about 40 pages this is not a problem. However, if the webpage contains more pages Firefox is unable to cope.
    While data is being sent to the printer a little green progress bar appears. This bar continues for a while and then stops. Some sort of timeout error appears (i can't remember the wording) and firefox becomes unresponsive. I have to start task manager in order to close Firefox.
    I then have to open a different browser in order to print the long webpage.
    Anyone know of any settings I can play with to fix this?

    Hi,
    Please also try this setting: Windows start menu or Control Panel > '''Devices and Printers''', right-click the printer > '''Printer properties''' > '''Advanced''', and select '''Start printing after the last page is spooled'''. In this case you can also close Firefox after spooling is over (usually much faster than direct printing), and printing will continue.
    Also as a general case, if you have security software (antivirus, firewall etc.) installed, you can try deleting all existing instances of Firefox and its related processes/files in all the different configuration modules/areas of the security software like process monitoring, sub/spawned process control, virtualization, HIPS etc., in addition to the security software's main configuration panel. Instead create new fully allowed/trusted rules for Firefox + its related processes in all the different modules/panels - a genuine/original Firefox installer as well as all the installed EXEs (Application) and DLLs (Application extension) are digitally signed by Mozilla Corporation (right-click > Properties > Digital Signatures). Even otherwise, some security software may also ask again when Firefox and/or its sub processes are started, and you may be able to allow/trust at that time. Please see [https://support.mozilla.org/en-US/kb/Firewalls this].
    [http://kb.mozillazine.org/Firewalls AV/Firewalls Configuration]

  • Launching command containing pipe from Java

    Hi,
    i have some troubles to launch a command containing pipe from java.
    I've tried to backslash the pipe but it still not work.
    Maybe someone has an idea about that :
    head -102050 /data/a_very_big_file | tail -5
    the idea is to get 5 lines in the middle of a very big file.
    To launch commands from java i use i think the classical way,
    something like :
    Process p = Runtime.getRuntime().exec(commande[0], this.envp, new File(this.pathExecution));
    I obtain this error :
    ERROR : head: invalid option -- 5
    ERROR : Try `head --help' for more information.
    Thanks for your help,
    kevin.

    kevleb wrote:
    yes same result...
    but i think the problem come from the fact
    that when you pipe your result of a command,
    you launch an other process (is that true).i don't know if another process is launched (the probability is rather high, though)
    but even if that's the case, from the time you rely on a shell and not directly on exec(), i think it shouldn't be a problem to include a | inside the command ; i don't have an idea why it gives you that message error :\

  • Launching jvm in solaris from java...

    I have a problem launching jvm from java in solaris...
    java.io.IOException: "/opt/XX/YY/jre/bin/java": not found
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    But when I give /opt/XX/YY/jre/bin/java from my console it's working fine...
    what could be the problem ?? (I mean the path is correct..)
    Message was edited by:
    chaos_begins_here

    When I try to System.exec() a program that doesn't exist, I get the following:
    java.io.IOException: foo: not found
    Note that foo (the program I tried to exec) is not in quotes. Check the strings you are passing to exec() to make sure there are no extra quotes. It's possible the difference in format is due to different java versions, but the point is to sanity check the strings you're passing.

  • How stored procedure get executed when called from java

    When we create a stored procedure or function in oracle, it is compiled and stored there. From java when we call them no compilation is performed its a simple call. When a function or stored procedure is invoked from multiple instance of java objects(for a single session), does the stored procedure clone it self so that it can be called by different java objects which I think not possible at all. In such cases when one java object is interacting with the stored procedure, does other java objects go on a wait state. What happens if sessions are different.
    Please help.

    >
    does oracle creates multiple instance of a particular stored procedure for different sessions or connections. if not then there might be some kind of waiting principle followed.. what happens exactly
    >
    What happens exactly is detailed in Chap. 14 Memory Architecture ni the Database concepts doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10713/memory.htm#i21266
    The code is shared but the data isn't (see the lone exception to this below).
    See the section on the Library Cache
    >
    Program Units and the Library Cache
    The library cache holds executable forms of PL/SQL programs and Java classes. These items are collectively referred to as program units.
    The database processes program units similarly to SQL statements. For example, the database allocates a shared area to hold the parsed, compiled form of a PL/SQL program. The database allocates a private area to hold values specific to the session that runs the program, including local, global, and package variables, and buffers for executing SQL. If multiple users run the same program, then each user maintains a separate copy of his or her private SQL area, which holds session-specific values, and accesses a single shared SQL area.
    >
    The exception is when code uses the SERIALLY_REUSABLE pragma. In that case the memory for package state is in the SGA and users do not have their own copy in their UGA.
    See the SERIALLY_REUSABLE pragma in the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/seriallyreusable_pragma.htm
    >
    The global memory for serially reusable packages is pooled in the System Global Area (SGA), not allocated to individual users in the User Global Area (UGA). That way, the package work area can be reused. When the call to the server ends, the memory is returned to the pool. Each time the package is reused, its public variables are initialized to their default values or to NULL.
    Serially reusable packages cannot be accessed from database triggers or other PL/SQL subprograms that are called from SQL statements. If you try, the database generates an error.

  • Trouble to invoke BPEL from Java Client following rmi example

    I still have troubles to invoke my BPEL process from Java Client by following tutorial sample of 102.InvokingProcesses/rmi .
    I created my Java class within NetBeans IDE. And the following line of code return null for url,
    java.net.URL url = ClassLoader.getSystemResource("context.properties");
    I think that I need to have SystemResource set up somewhere, how should I do that?

    if you using oc4j.. then please make a small change in oc4j_context.properties
    from
    java.naming.provider.url=[java.naming.provider.url]
    to
    java.naming.provider.url=ormi://hostname/orabpel
    And please make sure the context.properties file which gets copied to classes/context.properties has this above entry. For more details please refer to build.xml under rmi folder.
    Please do let me know if you face any issue.

  • Call ABAP from Java

    Can any one help me in calling an ABAP program from Java.
    The version of SAP with me is 4.7.
    Thanks in advance.
    Regards ,
    Nagaraju Donikena

    To call ABAP from Java when I tried doing it from sample code given in help I was getting the following error. Can any one help in this regard.
    Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classIniti
    alize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjco
    rfc in java.library.path]. java.library.path
            at com.sap.mw.jco.JCO.<clinit>(JCO.java:735)
            at TestConnect.<init>(TestConnect.java:8)
            at TestConnect.main(TestConnect.java:25)

  • Launching applications (use Java or is it possible in C)

    I'm a very newbie programmer in university still...
    In any case i'm only fimilar with C, C++ and Java. I'm trying to create a program that takes arguments from the command line, then launches the program identified in the command line.
    I know I can launch programs from java applications with: Runtime.getRuntime().exec
    but i'm not sure how a Java program would recieve arguments from the command line.
    I was thinking C or C++ might be more feasible, however i don't know how to lauch applications from within either language. I hear it's pretty easy to do what i'm asking with Visual Basic (but as I said I don't know it).
    Any help?
    Thanx in advance.

    but i'm not sure how a Java program would recieve
    arguments from the command line.Strange as it might sound, through the arguments of the main method:
    public static void main(String arguments[])

Maybe you are looking for