Run in command prompt
Hi,
I have a java application project which has a package with my code and one more package generated by web proxy.How can i run this in command prompt.
Or how can i create an executable jar with all required libraries and everything.
It's not recognizing javac, probably because you didn't set the PATH.
PATH="C:\Program Files\Java\jdk1.5.0_12\bin"Adjust it to the location of your bin folder.
Similar Messages
-
How to use addKeyListener in a program running using command prompt
Does anyone have any idea how to add the addKeyListener to a program running using command prompt.
Let me explain how the program run.
The program is start and accept call from other program. But from time to time, I need to issue some command by pressing the keyboard, let say, ESC is closed the program, F1 is showing the stated. F2.... (This is all need to run in the command prompt windows)
My problem is this program does not have any gui interface, so how can it be added?
i do it this way
public void key(){
addKeyListener(this);
But it have compile error.
mainServerImpl.java:87: cannot resolve symbol
symbol : method addKeyListener (mainServerImpl)
location: class mainServerImpl
addKeyListener(this);
I did implement KeyListener. But just don't know how to solve this error.
can anyone tell me how to solve it or point me a source that can help.
Thank in advance!
Regards,
Tai TanWrite your own Thread, to do this:
public class KeyThread extends Thread {
public void run {
while(true) {
int i = System.in.read();
if(i == 123) {
break; // to stop the thread
// in your main:
Thread keyThread = new KeyThread();
keyThread.start(); // calls run() of the thread -
How to run a command prompt " command " through java code
hi all,
There is a command
"java -jar selenium-server.jar -interactive"
which i am running through command prompt after going to D:\MyFolder\Examples .
i want to execute this command using java code .please helpThis has already been answered in your other two threads on this topic - http://forum.java.sun.com/thread.jspa?threadID=5221221&messageID=9898287#9898287 and http://forum.java.sun.com/thread.jspa?threadID=5221223&messageID=9898290#9898290.
For some reason you don't want to read the reference that tells you exactly how to do what you want and how to avoid the pitfalls - http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html . -
Hi all
Is it possible to run a command prompt(or DOS Command) through flash.If it possible please guide me to do that throug AS 3.0.
and
Is it Possible to run a activex (.OCX) file from flash. If it is so please guide me the way to do it
Thanks and Advance
Sankar.M.SOr create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).
-
Hi all
Is it possible to run a command prompt(or DOS Command) through flash.If it possible please guide me to do that throug as 2.0. and is it possible to run a Activex File(.OCX) through flash.
Thanks and Regards
Sankar.M.SOr create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).
-
How java runs in command prompt and why java runs on it
how java runs in command prompt and why java runs on it
command prompt was used before the development of IDEs like RAD,eclipse etc.
its still used for better understanding of the compilation and errors.
type the java file and save the file(source file) in the bin folder of ur jdk environment with extension .java. the source file must be the one that has the main method declared.
in the cmd prompt screen , set the path of bin folder.
eg:C:/program files/jdk(some version)/bin/...
for compilation,type:
javac (source file_name).java and press enter
for running the file:
java source file_name -
Encountering a RunTime error when I try running from command prompt
When I try to load my class from the command prompt I get the error:
Exception in thread "main" java.lang.NoClassDefFoundError: MiniTriangle
Since this seems like a pretty basic error, I'm hoping there's a black and white solution to it. Unfortunatly I don't have the slightest idea what that might be.
Any help would be appreciated, thanks in advance!!!I'm pretty new to this myself but have encountered this error before. I've found it happens when you try to run the programme and the class name isn't the same as the file name. So if you named the text file when you wrote the code MiniTriangle when you compile it you will get a file called MiniTriangle.class which is what you are trying to run. However if you inadvertently misspelled the class definition in the code and entered say
class MiniTringle {
you would get the error you are experiencing when you try to run MiniTriangle.class
Hope this helps -
Got an error while import script run in command prompt in R12
hi '
i am running the below script in command prompt in R12, but it will give an error
that error name:
'import' is not recognized as internal or external command,
operable program or batch file.
import C:\JDeveloper10g\jdevhome\jdev\myprojects\flsm\oracle\apps\po\per\webui\FlsmCreationPG.xml -rootdir C:\JDeveloper10g\jdevhome\jdev\myprojects -username XXFLS -password xxfls -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cph-oadb-tst22.dk.flsmidth.net)(PORT=1543))(CONNECT_DATA=(SID=TST22)))"
could you please help me on this.
Regards,
MuthuMuthu,
The import file directory is not in the path,
So run the script with full path,
<JDEV_DIR>\jdevbin\jdev\bin\import
Eg.
<JDEV_DIR>\jdevbin\jdev\bin\import <JDEV_DIR>\jdevbin\jdev\myclasses\xxt\oracle\apps\pon\registration\webui\XXTSupplierRegistrationPG.xml -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<DB_HOST_NAME>)(PORT=<DB_PORT>))(CONNECT_DATA=(SID=<DB_SID>)))" -rootDir <JDEV_DIR>\jdevbin\jdev\myclasses\ -rootPackage /
For scripts check this URL,
http://apps2fusion.com/at/61-kv/331-oa-framework-scripts
Thanks,
With regards,
Kali
OSSI. -
Runtime.exec() I need to run a command prompt command from java.
the code i have that doesn't seem to work is:
String driveloc = System.getProperty("user.dir").substring( 0, 1 );
String path = jTextFieldPath.getText();
String path2 = jTextFieldPath.getText().substring(0, jTextFieldPath.getText().length()-3) + "lst";
String[] cmd = { "cmd.exe", "/" + driveloc, "ASMtools\\AS11 " + path + " -L >" + path2};
txt_mf.append( cmd[3] );
try {
Process np = Runtime.getRuntime().exec( cmd );
catch( java.io.IOException ioe) {
//error
}jTextFieldPath.getText() contains the path of the file saved by my program.
the line of code i am trying to run is:
AS11 FILE1 -L FILE2this line compiles the asm file and converts it to a lst creating an s19 file in the process. AS11 is an exe that aids the command prompt much like javac.
If you could help me figure this out it would be great.
Thanks in advance,
-JukeString driveloc =
System.getProperty("user.dir").substring( 0, 1 );
String[] cmd = { "cmd.exe", "/" + driveloc,
"ASMtools\\AS11 " + path + " -L >" + path2};Are you sure you want to invoke cmd.exe with the switch /c or /d or whatever depending on System.getProperty("user.dir") ?
Starts a new instance of the Windows 2000 command interpreter
CMD [A | /U] [Q] [D] [E:ON | /E:OFF] [F:ON | /F:OFF] [V:ON | /V:OFF]
[[S] [C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be
Unicode
/T:fg Sets the foreground/background colors (see COLOR /? for more info)
/E:ON Enable command extensions (see below)
/E:OFF Disable command extensions (see below)
/F:ON Enable file and directory name completion characters (see below)
/F:OFF Disable file and directory name completion characters (see below)
/V:ON Enable delayed environment variable expansion using c as the
delimiter. For example, /V:ON would allow !var! to expand the
variable var at execution time. The var syntax expands variables
at input time, which is quite a different thing when inside of a FOR
loop.
/V:OFF Disable delayed environment expansion. -
Hi,
I am using SignTool.exe from a new Process() to verify a codesigned assembly and it returns the exit code 1 whereas it returns exit code 0 while i run the same from Visual Studio Command prompt. Please let me know your thoughts...
Here is my code snippet from VS2012 ultimate on Win7 PC.
p = new Process();
p.StartInfo.FileName = "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\SignTool.exe";
string args = @"verify";
p.StartInfo.Arguments = args + " "+ "/pa " + "/v "+ name;
p.Start();
p.WaitForExit();
pexitcode = p.ExitCode;
//name = "C:\\Users\\v-maparn\\Documents\\Visual Studio 2012\\Projects\\CodesignVerification\\CodesignVerification\\bin\\Release\\Microsoft.IT.Core.dll"
Thanks,
ManiHi Amy,
Thanks for your reply. I am receiving the exit code 1 by the Process even though the SignTool is able to successfully verify the assembly. I ran the below command from command prompt and received no errors or warnings. I assume the exit code should be 0.
I have also verified that this assembly has digital signature embedded as you can see from the output.
output:
C:\Windows\system32>signtool.exe verify /pa /v "C:\Users\v-maparn\Documents\Visu
al Studio 2012\Projects\CodesignVerification\CodesignVerification\bin\Release\Mi
crosoft.IT.Security.UI.SystemSecurityManagement.SSMUIWebHost.dll"
Verifying: C:\Users\v-maparn\Documents\Visual Studio 2012\Projects\CodesignVerif
ication\CodesignVerification\bin\Release\Microsoft.IT.Security.UI.SystemSecurity
Management.SSMUIWebHost.dll
Signature Index: 0 (Primary Signature)
Hash of file (sha1): 1B58113B218260837A6B850561538A804B034F2A
Signing Certificate Chain:
Issued to: Microsoft Root Certificate Authority
Issued by: Microsoft Root Certificate Authority
Expires: Sun May 09 15:28:13 2021
SHA1 hash: CDD4EEAE6000AC7F40C3802C171E30148030C072
Issued to: Microsoft Code Signing PCA
Issued by: Microsoft Root Certificate Authority
Expires: Mon Aug 31 14:29:32 2020
SHA1 hash: 3CAF9BA2DB5570CAF76942FF99101B993888E257
Issued to: Microsoft Corporation
Issued by: Microsoft Code Signing PCA
Expires: Thu Apr 24 14:33:39 2014
SHA1 hash: 108E2BA23632620C427C570B6D9DB51AC31387FE
The signature is timestamped: Mon Dec 30 02:58:12 2013
Timestamp Verified by:
Issued to: Microsoft Root Certificate Authority
Issued by: Microsoft Root Certificate Authority
Expires: Sun May 09 15:28:13 2021
SHA1 hash: CDD4EEAE6000AC7F40C3802C171E30148030C072
Issued to: Microsoft Time-Stamp PCA
Issued by: Microsoft Root Certificate Authority
Expires: Sat Apr 03 05:03:09 2021
SHA1 hash: 375FCB825C3DC3752A02E34EB70993B4997191EF
Issued to: Microsoft Time-Stamp Service
Issued by: Microsoft Time-Stamp PCA
Expires: Wed Feb 11 14:11:31 2015
SHA1 hash: D967AB4CF991F11DA6E318C880F1AF1A9C8D2C7C
Successfully verified: C:\Users\v-maparn\Documents\Visual Studio 2012\Projects\C
odesignVerification\CodesignVerification\bin\Release\Microsoft.IT.Security.UI.Sy
stemSecurityManagement.SSMUIWebHost.dll
Number of files successfully Verified: 1
Number of warnings: 0
Number of errors: 0
C:\Windows\system32>
Thanks,
Mani -
Jar run from command prompt?
Hi !
How do I run my Jar from the command prompt window?
my jar's name is " javaproject 7"
Thanks!Java application launcher documentation:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html -
Scanner works in JCreator but doesn't when run from Command Prompt?
Can someone tell me why I can run this program in JCreator with no problems, but when I run it with the Command prompt it throws a java.util.InputMismatchException if I input anything?
import java.util.Scanner;
public class tester {
public static void main(String[] args) {
Scanner in = new Scanner(System.in).useDelimiter("\n");
System.out.println("Type either 1 or 2");
int temp = in.nextInt();
System.out.println("");
if (temp == 1)
System.out.println("you typed 1");
if (temp == 2)
System.out.println("you typed 2");
else
System.out.println("you typed something else!");
}Try this code it is running correctly on command prompt
import java.util.Scanner;
public class tester {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Type either 1 or 2");
int temp = in.nextInt();
System.out.println("");
if (temp == 1)
System.out.println("you typed 1");
if (temp == 2)
System.out.println("you typed 2");
else
System.out.println("you typed something else!");
} -
RunInstaller fails while running from command prompt
Hi,
The runInstaller when run fails from command prompt:
Starting Installation...
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /vol2/newtmp/OraInstall2009-05-17_11-02-45PM. Please wait ...Success!
Done!
[oracle@saudas oracle]$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.
Unexpected Signal : 11 occurred at PC=0xF7D617CE
Function=(null)
Library=/vol2/newtmp/OraInstall2009-05-17_11-02-45PM/jre/1.4.2/lib/i386/client/libjvm.so
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
I have made a temporary directory logged as root user:
Then login as root:
$mkdir /vol2/newtmp
$chown oracle:oinstall /vol2/newtmp
$chmod 777 /vol2/newtmp
Then login as oracle:
$export TMP=/vol2/newtmp
$export TEMPDIR=/vol2/newtmp
Any help will be needful for me
Thanks and Regardsuser598986 wrote:
I am using Oracle 10g Server Release 2 64 bitThat's a good start.
The OS is:Red Hat Linux 64 bit.Which version ?
Did you set DISPLAY env variable ? Did you set the kernel to the required value ?
Check again all the prerequisites.
Nicolas. -
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 advanceHey,
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. -
Running my application from command prompt
Hi im a student and kind of a rookie. My program runs fine from eclipse but when i run from command prompt it gives:
Exception in thread "main" java.lang.MoClassDefFoundError: Mainclass
This is what i am typing: java Mainclass. And i am sure i am in the right folder. I know it gives the same problem when you are not in the right folder. ALso my program uses jre5.0 and it runs fine on eclipse.
Any help greatly appreciatedFrom the directory containing Mainclass.class try java -cp . Mainclass The effect of "dash cee pea space dot space" is to
set the classpath to the current directory.
Maybe you are looking for
-
ADFc: No view port found when using both Browser dialog and TF inline-popup
Hi, Using JDev 11.1.1.2. We have a table with data and two commandlinks. One navigates to a task-flow-call configured to "run as dialog" in a modal inline-popup. This opens a modal inline-popup that can be used to modify the data. The second command
-
No audio in safari or other apps
cant hear any audio streaming over the net while in safari, if I get an email attach with a .mov or .wma file cant hear the audio, I have downloaded some things to my hard drive and when playing them in quicktime cant hear audio. if I hit the volume
-
OSA - Default Manager From Org Unit
Hi everyone: In my appraisal form, under "Processing" tab, in "Further Template Behaviour", I have included the standard BADI (Default Appraiser - Default Manager). Is this BADI supposed to pick the manager (chief position) of the org unit that belon
-
Is it possible somehow get the Camera "light" off ...
So...Always when i take picture with my N8 it flashes the red light...its really annoying...And in options there aint no thing for turn this off. Does anyone now anyother solution? This same light is almost on every nokia phone...If somebody doesnt k
-
Dear all, I created a very simple workflow. Besides the "start" and "end" step, there's only one step, which just writes a record into DB table. This step has no agent. I tested it via transaction SWUS but found the status is always "in progress". Th