Executing java in command prompt

how can i execute java in cmd and log the result at the same time?
as i'm hitting problem with the class that i remotely executed and do not know what happen at all :(
thanks alot!!

so does it mean .. java runapp > output c:/log >
error ?? how i get the error message..
thanks
java RunApp > C:\log 2> C:\errorView the error file to see the error message.

Similar Messages

  • Problem with executing java on command prompt

    Hi my program uses java mySQL connector to connect to a local host. The program works fine when i run through netbeans. But when i run through command prompt it gives in this error message
    java.lang.ClassNotFoundException:com.mysql.jdbc.Driver Can anyone help me to solve this problem

    add mysql.jar file to ur classpath, it will work fine.

  • Error when executing scenario use command prompt - startscen

    Hi All,
    Anyone know how to solve this error? I get this error message when I execute command prompt: startscen scenarioName version001 contextDevelopment "-v=2"
    The error message is:
    java.lang.NullPointerException
    at com.sunopsis.g.a.f.b(f.java)
    at com.sunopsis.tools.core.SnpsStringTools.a(SnpsStringTools.java)
    at com.sunopsis.dwg.DwgObject.snpsDecypher(DwgObject.java)
    at com.sunopsis.dwg.DwgJv.treatCmd(DwgJv.java)
    at com.sunopsis.dwg.DwgJv.main(DwgJv.java)
    at oracle.odi.Agent.main(Agent.java)
    I use JDK version 1.4.
    Thanks in advance.
    Regards,
    Sumardi

    Hi Sumardi,
    Trying to help you,
    Please cross check the repository configuration information in ODIPARAM.BAT file.
    Thanks,
    G

  • Java and command prompt

    easy and quick question, when running a java program in command prompt and you want to stop it early or want to stop it if in an infinite loop without closing command prompt whats the command to do that? For the life of me i cant remember.

    In Windows, press Control-C.
    This is not a Java related question though.
    Vincent

  • How do i get a output in CSV of a SQL query executed via SQL Command prompt

    Hi All,
    I have a question with reference to SQL command prompt. I have a sql query which runs properly and gives proper execution in SQL Management console in GUI.
    This report is used to pull the free disk space report of our servers
    As i want to schedule it as a report so i want to script it to run via SQL command prompt. I made the script and it works fine if i enter it in SQL command prompt. When i try to extract the output to a CSV File it fails. Below is the details of the command
    i am using to query to pull the data. Can anyone help me in getting the output of this query in SQL command prompt.
    sqlcmd -W -s , -S Servers FQDN
    use operationsmanager
    Go
    Query:"select Path, InstanceName, SampleValue 
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled" -s "," -o "C:\DataSqlCmd.csv"
    Go
    When i enter the command without the quotes when the query is starting and ending and also without the output command (-s "," -o "C:\DataSqlCmd.csv") it is working and shows the output in the command prompt. Below is the screen shot for
    your reference.
    Due to security reasons i have to erase the server names:
    But when i add the line to extract the output ( -s "," -o "C:\DataSqlCmd.csv") It gives me this error:
    The exact command would be:
    sqlcmd -W -s , -S CINMLVSCOM01.e2klab.ge.com
    use operationsmanager
    Go
    "select Path, InstanceName, SampleValue 
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled" -s "," -o "C:\DataSqlCmd.csv" -h-1
    Go
    saying the syntax is not correct or some thing as per the below screenshot.
    Can any one please help. Below is just the query whi i use to get the output in SQL management studio.
    Can any one make a command for the below quer so i can directly execute and test for getting the output.
    select Path, InstanceName, SampleValue 
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled
    Gautam.75801

    Can you try the below query?
    select Path, InstanceName, SampleValue
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < 20 and CounterName like '% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled
    -- replace the below query part in the below SQLCMD C:\>SQLCMD -S SERVERNAME -E -d operationsmanager -Q "select * from sys.databases ds with (nolock) where name='master'" -s "," -o "F:\PowerSQL\MyData.csv" -h -1
    SQLCMD -S SERVERNAME -E -d OperationsManager -Q "select Path, InstanceName, SampleValue
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled" -s "," -o "c:\MyData.csv" -h -1
    Refer for the other ways 
    http://dba.stackexchange.com/questions/23566/writing-select-result-to-a-csv-file
    --Prashanth

  • Executing servlet in command prompt

    Can we run the servlet in the cmd prompt .
    I am using tomcat5
    server in windows Environment .

    Can we run the servlet in the cmd prompt .**sigh**Dont see any reason why you would want to do
    this, but yes you could.
    Put a main method, create an instance of the servlet
    and call the various methods like in any other java
    class. You would have to generate a request and
    response object to call the processing methods.
    Note::: This servlet when run in this fasion wouldnt
    be responding to a browser request which is what it
    was originally intended for and you wouldnt be able
    to do a darend thing with the o/p.
    I am using tomcat5
    server in windows Environment .doesnt matter, you are invoking from the command
    prompt, the container has no role to play here.
    Note: On second thoughts, you could post a http
    request from a telnet prompt.
    GET HTTP/1.1 /url/This would post the request to the server which would
    invoke the servlet - dont know if this is what you
    are looking for.
    cheers,
    ram.I think this defeats the purpose of servlets- no request-response mechanism.

  • Running java from command prompt?

    What do I need to be able to run java code from the command prompt? I have J Builder and when I have questions, mainly people give want me to run from command line. When I do so it says it does not know what javac is.

    javac, java etc.. commands are in the j2sdk\bin directory.
    So you have to give PATH to that bin directory in order to use it in command line. Go to the JBuilder installation folder and look for the j2sdk. (JBuilder comes with the j2sdk but the name may vary)
    If you find it, then give the PATH to it's bin directory.
    Or you can download the j2sdk from sun seperately, and give the PATH to its bin directory.

  • Running Java without Command prompt support

    Hi,
    Can I run my class file without showing the command prompt in background.
    I tried with javaw, but its not working. I have jdk1.5 installed.
    please help me

    Jar files (<wavey subliminal type effect>search button</wavey subliminal type effect>) are on most modern OSes double clickable.
    http://java.sun.com/docs/books/tutorial/jar/index.html

  • Issues executing report from command prompt

    I'm using Oracle 10g Reports and attempting to execute a report from my workstation to output in a spreadsheet format. We don't have a Reports Server implemented at this time, so I'm simply connecting to the database with Reports Builder and running reports. I can execute a report just fine from Reports Builder and output as PDF; however I'm not familiar with how to output as spreadsheet. From what I understand, spreadsheet output cannot be accomplished through the tool, only from the command prompt. I've tried executing the a command inthe following format from Windows XP command prompt, but no luck:
    rwrun report=test_report.rdf userid=[usernam/pwd@db] desformat=spreadsheet destype=file desname=c:\temp\test_report.xls
    Nothing occurs...no output, nothing when this command is entered. What is the issue? Can rwrun.exe even be used for executing on the client-side? According to Oracle documentation, rwrun is the executable that runs a report using the OracleAS Reports Services.

    Hello,
    Even if the parameter is deprecated, you can use errfile=c:\temp\reports.err and check if there are some errors ..
    or check for a file reports.log
    Regards

  • Using java from command prompt

    Hi, I have used command prompts for a long time, though not recently. But this has never happenned to me, and I may have been using a different OS the last time I really used a command prompt. I am currently running Windows XP.
    Anyways, when I try to simply change a directory, you know cd "filename", it tells me:
    Parameter format not correct - "filename"
    Basically, it won't accept any strings as a parameter. I'm really surprised at this. Is this normal? In any case, I got around this by using the short names for files. For example, I used the name docume~1 instead of "documents and settings".
    Then, when I got to the folder where my java files were stored, it told me it was an invalid directory but nonetheless allowed me to use it. However, no commands worked except for cd..
    Java did not work, nor did basic commands like dir or help. Do you have any idea what is wrong with my command prompt? I know this is not specifically a question about Java, but I can't use Java without this.
    thanks.

    Basically, it won't accept any strings as a parameter.
    I got around this by using the short names for files. For example, I
    used the name docume~1 instead of "documents and settings".So it is accepting some strings.
    Check that you are using cmd.exe not command.com. Ie, from
    Start->Run... typecmdAnd not command.
    Try the javac command and if the computer says'javac' is not recognized as an internal or external command,
    operable program or batch file.then will have to set your OS path (not CLASSPATH - do not set
    CLASSPATH at any time or the command prompt will likely never work
    again).
    Instructions for setting the OS path are [urlhttp://java.sun.com/j2se/1.5.0/install-windows.html]here. Scroll down to
    point number 5

  • Ruuning java at command prompt

    Totally new to using java technology and i've set up the classpath variable and installed the files checking the size yet i cant work out how to run the program or where from! I apologise for my ignorance. I've got files which where wrooten and compiled on a linux based machine now i'm trying to run them on Windows...Where do i start?

    on windows
    set PATH=C:\JDK1.3.1\bin;%PATH%
    (here in place of c:\jdk1.3.1\bin you can specify the bin directory of the place where you have installed the jdk... of you don't remember where you had installed it, then just find javac.exe on your disk and specify its directory here in place of c:\jdk1.3.1\bin)
    now go to the directory where you have kept your java programs.
    type java -version
    and you should see the version of the jdk that you have installed. on typing javac the java compiler should run.
    If you are on Unix (or unix like) platforms
    type
    export PATH=/opt/jdk1.3.1/bin:$PATH
    (here again instead of /opt/jdk1.3.1/bin you have to specify the directory where you have installed your jdk.)
    hope this helps. let me know if you need more assistance.
    regards,
    Abhishek.

  • How to execute a scenario from Windows command prompt

    Hi,
    I have a package which is executing fine from Designer. But the same scenario if I am trying to execute from windows command prompt, then it is giving error.
    The package is getting a refresh variable, passing to interface which is creating a file from table, this file is then getting FTP'ed to another server.
    I am executing following command -
    startscen OB_TAB_TO_FILE_PKG 001 ODICTX "-v=2"
    The error is -
    A JDK is required to execute Web Services with OracleDI. You are currently using
    a JRE.
    OracleDI: Starting scenario OB_TAB_TO_FILE_PKG 001 in context ODICTX ...
    java.sql.SQLException: socket creation error
    at org.hsqldb.jdbc.jdbcUtil.sqlException(jdbcUtil.java:67)
    at org.hsqldb.jdbc.jdbcConnection.<init>(jdbcConnection.java:2451)
    at org.hsqldb.jdbcDriver.getConnection(jdbcDriver.java:188)
    at org.hsqldb.jdbcDriver.connect(jdbcDriver.java:166)
    at com.sunopsis.sql.SnpsConnection.u(SnpsConnection.java)
    at com.sunopsis.sql.SnpsConnection.c(SnpsConnection.java)
    at com.sunopsis.sql.i.run(i.java)
    DwgJv.main: Exit. Return code:-1
    Please let me know where I am going anything wrong.
    Thanks,
    Himanshu

    Hi,
    you need to make the necessary changes to the %odi%\bin\odiparams.bat config file, under the "Repository Connection Information" section so that startscen knows how to extract metadata from your repository.
    You apparently have left the default settings to the Hypersonic demo repository. Is that the technology your repository is hosted on?

  • Running eclipse java project on command prompt

    Hi all,
    I have one simple java project and that is very well running in eclipse. I have added some external JARs to that project. It performs this job- it creates connection to server, and listens to the signals from server.
    My question is - how do I run that java project on command prompt?*
    I want to run that using ANT or simply I want to make a JAR file so I can execute JAR on command prompt. I created JAR, but it doesn't contain external jar which I added to the project. So I was not able to run that project.
    Can you please tell me any of the method - using ANT or by making JAR?
    Also can you be little bit more explanatory in reply?
    Thanks

    I want to make a JAR file so I can execute JAR on command prompt.This is very likely a good way to proceed. It is explained in great detail in Sun's Tutorial in the section on [Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html].
    I created JAR, but it doesn't contain external jar which I added to the project. So I was not able to run that project.Yes - the jar file you create has to know about the classes and other resources in that external jar. Otherwise, at runtime, the program will not be able to get at the stuff it needs. Usually you don't include that other jar (or its contents) in the jar file you are creating. Instead you provide your jar file with a manifest that describes the other jar's location. Details are also in the tutorial.
    One thing to note is that Sun's tutorial provides a lot of explanatory, conceptual, material. To that end it keeps the context simple and transparent by describing the steps as they would be carried out by someone working at the command line. The Eclipse documentation and forums might provide a more click-this-drag-that "explanation". If you do follow the method in the Tutorial and get stuck, post a description of the actual commands you used and their outcome.

  • Will launch in Eclipse, won't launch from command prompt

    I've got a project that works in Eclipse, but won't run from the command line prompt.
    The command line command that I'm using is this...
    java -cp /users/shared/RainfallSeriesTranslator/bin ui/LauncherThe error I get is this...
    Exception in thread "main" java.lang.ExceptionInInitializerError
    Caused by: java.lang.NullPointerException
         at ui.Launcher.getMethods(Launcher.java:37)
         at ui.Launcher.<clinit>(Launcher.java:15)and the class is this...
    import java.io.File;
    import java.io.FilenameFilter;
    import java.util.ArrayList;
    public class Launcher {
         private final static String name = "RainfallSeriesTranslatorPanel";
         private final static String[] methods = getMethods();
         private final static String fileExt = ".class";
         public static void main(String[] args) {
              new Panel(name, methods);
         public static String[] getMethods() {
              String workingDirectory = System.getProperty("user.dir");
              String fileSeparator = System.getProperty("file.separator");
              String methodDirectory = workingDirectory + fileSeparator + "bin" + fileSeparator + "methods";
              File dir = new File(methodDirectory);
              ArrayList <String> methodsAL = new ArrayList<String>();
              FilenameFilter filter = new FilenameFilter() {
                      public boolean accept(File dir, String name) {
                          return name.endsWith(fileExt);
              String []contents = dir.list(filter);
              for (int i = 0; i < contents.length; i++){
                   methodsAL.add(contents.replace(fileExt, ""));
              return methodsAL.toArray(new String[methodsAL.size()]);
         public String getPanelName() {
              return name;
         public String getFileExtensionName() {
              return fileExt;
    }BTW the purpose of getMethods is to dynamically list out the classes (files) in the directory 'methods', and to load the names into an array which is passed to a JComboBox in the Panel.  My intention is to permit users to select which method to use for the next step of the analysis.  If there's a better way to do it, I'd like to know.
    Having played around with the code, I can get it to run if I 'hardwire' the methodsAL arraylist to ...          methodsAL.add("Some method");...but that defeats the purpose of reading in the classnames dynamically.
    So, the nullpointerexception seems to do with the array 'contents' not getting populated, but I can't figure out why.  As I noted above, it works in Eclipse, so why doesn't it work from the command prompt?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Martin_J wrote:
    Sorry, I had cut out some comment lines at the top.
    Line 37 is the line
    for (int i = 0; i < contents.length; i++){So it looks like the nullpointerexception is generated because the array 'contents' has a null (zero?) length.
    On reflection, is this to do with the working directory? You will note that I have prepended the 'methods' directory with the working directory path. I'm thinking that this would work in Eclipse because the working directory is something, but it does not work when I execute from the command prompt because the working directory is something else.
    If this is the case, then what is the best way to find a directory at a relative location to a class?You get that error because the directory doesn't exist at the given location (the bin folder I guess). dir.list() returns null.
    Kaj

  • How to pause output in command prompt

    I have 10 sentence for instance, i want to display one sentence each time i press enter. Does anyone know how to do it in java?(command prompt)

    1. Wrap the default System.err and System.out in your own PrintStreams
    2. Replace them with your wrapper classes (see System.setErr(PrintStream) etc)
    3. In the wrapper classes, parse output looking for '\n' chars + any time you find one, write to that point, then read a return from System.in

Maybe you are looking for

  • Unable to launch PS CC Mac OSX 10.9

    I have installed PS CC on 2 Max's with the same result on both The splash screen shows, the app opens for a couple of seconds then closes There is no error reported and I can not find an issue in a log. I have followed a multitude of information on d

  • Doesn't recognize FCP7 the thundebolt

    hi, i have a big issue with FCP 7... in my new iMac its doesnt recognize the thunderbolt adapter to Firewire 800 in Log and Capture... i have a dvd player that its RCA output, then i have a RCA to DV (Firewire400), then i have a FW400 to FW800 adapte

  • How do I find and download Visual voicemail?

    How do I find and download Visual Voicemail on my iPhone?

  • How to locate my downloaded games in my yendo?

    how to locate my downloaded games in my tendo??

  • Re-importing a lost book from pdf

    Hello. About 2 years ago the mover dropped my iMac and pooched my drive. After a new drive was installed I was able to recover all my photo's but never any of the projects (Calendars, Books etc.) Now I wish to reprint a book I made, but no longer hav