Java Code Compilation in Windows Command Prompt

Hi Everyone,
I have been programming in java for quite some time now using an IDE (eclipse). I downloaded the following java file from:
http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.html#requirements
and have downloaded the required JMF. The problem is that I want to compile and run this code in Windows Command Prompt; however, I keep receiving errors upon compilation because I do not know how to make jmf.jar be recognized as a library.
Thx.

javac -cp jmf.jar;otherJars file1.java file2.java file3.java...
Run java and javac from the command line for an explanation of their options.
Edited by: nclow on Jul 24, 2008 1:43 PM

Similar Messages

  • Java code to minimize the command prompt window when we hit

    Hi All,
    I am using Command promt to convert frame maker files to pdf files... When I hit the batch file, Command prompt window is coming on to the center of the screen, customer doesnt want this one .
    Is there anyway to minimize the command prompt window like we can show up in the status bar and not on the screen .

    To get better help sooner, post a [_SSCCE_|http://mindprod.com/jgloss/sscce.html] that clearly demonstrates your problem.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db

  • How to install Java to compile Sevlets at command prompt

    Please help me to compile my java servlets at command prompt.
    I have buyed a new leaptop with windows XP service pack 2
    I have downloaded Java EE 5 SDK Update 4 (with JDK 6u5) for Windows, English
    I setted my path and classpath variable for bin and lib folder..
    I could not able to compile my servlet programs
    I am getting errors for all my servlet package classes and servlet.http. packages.........

    Hi Jeff,
    Follow the steps ...
    First you install JDK, it can be 1.2, 1.3, 1.4.
    Lets say you install it in c:\jdk13\ then c:\jdk13 becomes your Java Home Path.
    Edit your autoexec.bat using any editor. And add the Following Lines.
    SET CLASSPATH=C:\JDK13\SRC.JAR;C:\JDK13\LIB\TOOLS.JAR;C:\JDK13\LIB\DT.JAR
    These are the Jar files that need to comile and execute your Java Programs.
    Next add the JDK Binary executables folder in the Windows Path.
    Add this line to the end of your Autoexec.bat
    PATH=%PATH%;C:\JDK13\BIN
    The %PATH% Variable will append the Bin path to the existing path.
    Dont worry about the Case of the statements but dont Leave Spaces after in between after the PATH= Words in any of the above statements.
    Its reccomended to Restart your PC for these commands to take effect.
    Then write a Java Class and compile it with javac yourClass.java and then run it with java yourClass
    Hope this is clear enough.
    Regards ,
    Max

  • Using Java in windows command prompt

    Hi,
    I don't know if I have been searching correctly, but I haven't found a solution to my problem through common search engines.
    I'm programming in java using vim (accessed through windows command prompt), and I've created classes, everything compiles fine.
    However, I wanted to test my classes my creating instances of them (i.e. objects) through the same windows command line (command prompt). I know you can achieve this by using interaction panes through third party programs such as Dr.Java and eclipse, but I was wondering if this can be done using the command line.
    Thanks
    Jaime

    Thanks Paulcw for your quick reply! :D
    I'm guessing I didn't word my question properly.
    Neither of my classes have a main method in them, so when I am trying to create instances (objects) of them, I would like to as if my command line was the main.
    For example:
    Class1 c = new Class1(parameters);
    c.moveRight();
    etc.
    I'd like to be able to use my classes methods from the command line, I think what I'm looking for is a batch, but I'm not sure.
    Thanks again,
    Jaime

  • Manipulating Windows command prompt through Java

    I am wondering if there is any way to manipulate simple Windows command prompt commands like color, cd, dir, cls through a java application. Any help or informative redirection would be much appreciated.

    BinaryBurnout wrote:
    I am wondering if there is any way to manipulate simple Windows command prompt commands like color, cd, dir, cls through a java application. Any help or informative redirection would be much appreciated.Realize that the Windows command prompt is an application (cmd.exe), and those commands are specific to that application.

  • 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?

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

  • TDMS Defragment​-Through Windows Command Prompt

    Dear All,
    we need to Defragment the TDMS file  by TDMS Defragment.VI  via Windows Command Prompt.
    Work flow will be as below
    1.An Application wil be created to defragment using TDMS Defragment.VI
    2. When user stop Main Application (App 1) which records data for long time in tdms  ,the Main application (App 1)  will call defragmenting Application (App 2) via cmd and should get the file path and start defragmentation and it should pop a message defragmentation completed. and dont want Main Application  (App 1)  to do anything apart from triggering tdms defragmentation.
    Reason is We dont want the Main Application (App 1)  to wait for Long time till defragmentation and Since we need to use the Main Application (App 1)  for other testing.
    So we decided to do this defragmentationin in some other way  and display the completion message to user
    please provide suggestions 

    I'd also recommend doing this in one application.  If you truely want to do it from a command line you can.  LabVIEW built EXEs can support command line switches if you enable it in the build specificaitons.  If you do this you'll probably want to support multiple instances, and code it so that it will exit once the conversion is done.  But again you can get more information from the result of the defrag (like error) if you do it in the same application.
    Taki1999 wrote:
    EDIT: Asynchronously is difficult to spell
    Totally agree and some spell checks claim it isn't a word.  Same with programmatically.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Unable to connect to database from windows command prompt

    Hi All,
    Im trying to connect to Oracle database from my windows command prompt, these are the steps I followed:
    1) cd C:\oracle\product\11.2.0\client_1\sqlplus
    2) sqlplus username\password@hostname:1521\service_name
    I do get the error ORA-06401: NETCMN: invalid driver designator
    I did try using the SQLPLUS \NOLOG
    Connect username\password@hostname:1521\service_name
    I still get the same error.
    I did manually type all the commands to make sure no additional charaters coming and etc...How shall I overcome this...

    user9103174 wrote:
    Hi All,
    Im trying to connect to Oracle database from my windows command prompt, these are the steps I followed:
    1) cd C:\oracle\product\11.2.0\client_1\sqlplus
    2) sqlplus username\password@hostname:1521\service_name
    I do get the error ORA-06401: NETCMN: invalid driver designator
    I did try using the SQLPLUS \NOLOG
    Connect username\password@hostname:1521\service_name
    I still get the same error.
    I did manually type all the commands to make sure no additional charaters coming and etc...How shall I overcome this...do you desire/plan on using EZCONNECT or tnsnames.ora entry?
    EZCONNECT sample is below
    sqlplus user1/pass1@'dbserver:1521/orcl_sid'

  • Log ConsoleHandler + Windows Command Prompt

    Having really strange problem:
    Program started from Windows Command Prompt.
    Logging with ConsoleHandler.
    If select something with "Edit->Mark" in this Command Prompt, process stop responding.
    Has anybody seen such behavior?

    Correction:
    Looks like anything writing to stdout/stderr hangs in Windows Command Prompt "mark" mode.
    Could not find anything about how it works.

  • How to get no. of rows of Windows Command Prompt in java

    hi all,
    can anybody tell me that is there any java utility avalilable throght I can find the how many rows avalilbe on currently executing command prompt, and also how can i clear the content of command prompt (result of 'cls' command).
    Currently execting command prompt means from where I have run my java program.
    any reference is also welcome.
    thanks in advance.

    Clearing the screen is trivial, as long as you're OK with making your program specific to Windows only (i.e. you never hope to run it on any other OS ever):
    Runtime.getRuntime().exec("cmd /c cls");As to figuring out how many lines your command window's screen buffer has - good luck with that. I'm not familiar enough with the Win32 API to get this info, but you'll have to figure out what that is, and call it via JNI.

  • How to compile & run using command prompt

    Hi all,
    I have a java application consisting of 3 packages & a jar file in the following hierarchy:
    -Project
    -classes
    -src
    -package1
    -package2
    -package3
    -file.jar
    The main class exists in package2 and uses classes within file.jar
    I want the steps to compile and execute the project using command prompt in windows such that the generated classes will be saved in the classes directory
    Can anyone help?
    Thanx in advance

    Hey,
    If your source(*.java) files are in src folder and ur currnet directory is project
    and you want all your class files to be classes folder then you can try this :
    c:\project>javac -cp src\file.jar -d classes\ src\*.javaAssuming that your file.jar file is in src folder.
    The above command will set the classpath to src\file.jar (-cp src\file.jar)
    -d classes\ - will generate all your class files with package hierarchy if any into classes directory.
    src\*.java - specifies the files to be compiled.
    Hope this helps.

  • Compiling via the command prompt?

    Hi, I need to compile a program via the command prompt, and I need help setting up the windows environmental variables. I have followed multiple online tutorials on how to do this, but I keep getting the classDefNotFound exception. Can somebody please tell me which variables I should set? Thanks.

    since you are getting a java error, you don't need to change your PATH. All what remains is your CLASSPATH variable. Let's say you have created a directory c:\classes and you store all your classes in subdirectories according to their package. Then your CLASSPATH would like like this:
    .;c:\classes
    Note the dot at the beginning, that means "current directory", so the directory where you invoke java/javac is also part of the classpath. Note also that each item in the classpath is seperated with a ; .
    If you need to add jars to the classpath, don't add the directory containing the jars but add the jars themselves.
    .;c:\classes;c:\jar\yourjar.jar;c:\jar\otherjar.jar
    Hope that helps.

  • Java code compile

    Hi :
    can you tell me how to compile java source code.
    i have three java file in different packages in a same project.
    now i want to compile all the java file in single command.
    like this i used.....
    JAVAC *.JAVA
    i can't compile this , can u advise me how to compile ,please tel me the correct cmmmand

    georgemc wrote:
    davvidmaria wrote:
    ok buddies i got u r point my project manager is asking that technique, how to compile whole java file in a command prompt(java file located in a different packages)Tell him it would be a waste of your time to do it like that, and also it puts your project at risk, since compiling loads of classes by hand is boring, and whoever is doing it is bound to make some mistakes. An Ant script won't make mistakes, and takes a few seconds to run, as opposed to goodness-knows how long for a manual compileSeconded. Can we get a consensus? ;-)

  • Is it possible to run a java program without using the command prompt?

    Hi,
    I was wondering whether it is possible to run a Java program (not an applet) without using a command line in the command prompt?
    Basically I want to run a program that will be continually running in the background and hence I don't want to have a command prompt screen loaded up as well - I just want the program to be running in the task bar.
    I know how to run the program in the task bar - but I still need to launch the program from the command prompt - is there anyway I can get a program running without having to start it from the command prompt?
    Cheers

    Or create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).

Maybe you are looking for