karan, chopra

Ranch Hand
+ Follow
since Jun 05, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by karan, chopra

hi there,
does anybody know how to make a windows executable file from java class files using visual cafe.i would appreciate any help.its very important for me.
thanks
karan
16 years ago
hi all,
i am trying to make a windows executable file from the java class files and i am using a microsoft tool called "jexegen" for this.actually i have successfully generated the executable file but the problem is that it does not run on any other computer other than the one in which i generated it.when i run it on other computers i get an error called "cannot start application.unable to locate class file"..
does anybody know why am i getting this error.i do remember to install microsoft virtual machine on each computer before i try to run this executable(its a requirement) but still i get this error.dunno why..any ideas folks,would really really appreciate any help in this matter..
thanks a lot in advance
karan
16 years ago
hi,
but if did not bind with some class then it should not even work in the originating machine right?do you know of any other tools that help in converting java class files into a windows executable?please let me know if you do..
thanks
karan
16 years ago
hi all,
i am trying to make a windows executable file from the java class files and i am using a microsoft tool called "jexegen" for this.actually i have successfully generated the executable file but the problem is that it does not run on any other computer other than the one in which i generated it.when i run it on other computers i get an error called "cannot start application.unable to locate class file"..
does anybody know why am i getting this error.i do remember to install microsoft virtual machine on each computer before i try to run this executable(its a requirement) but still i get this error.dunno why..any ideas folks,would really really appreciate any help in this matter..
thanks a lot in advance
karan
16 years ago
hi there,
Please pardon me if this question is out of this league,but i need some information about the following,so i thought of posting it here and see if somebody could help me out..
actually i have a couple of java source(and class files ofcourse)files and i was wondering if any of you folks could tell me how to make a standalone application(an executable) from these source files that i can run on any computer without having to install java in that computer.the main page(the front screen of the application) is a java frame,and i am calling various other java files(frames again) from this frame.I would really appreciate the help.
thanks in advance
karan
16 years ago
hi there,
i have a couple of java source files and i was wondering if any of you folks could tell me how to make a standalone application(an executable) from these source files that i can run on any computer without having to install java in that computer.the main page(the front screen of the application) is a java frame,and i am calling various other java files(frames again) from this frame.I would really appreciate the help,its kinda urgent.
thanks in advance
karan
16 years ago
hi william,
following is the code that i have for running the exec:
try
{
if (windows)
{
// cmd = 'rundll32 url.dll,FileProtocolHandler http://...'
cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
Process p = Runtime.getRuntime().exec(cmd);
}

}
catch(IOException x)
{
// couldn't exec browser
System.err.println("Could not invoke browser, command=" + cmd);
System.err.println("Caught: " + x);
}
but whenever i try to print something out in the catch block then the program doesnt doesnt print anything..thats probably bcoz its not executing the catch block bcoz there are no exceptions generated,but suppose for some reason the executable file is not present in the dir in which the program expects it to be,what happens in such a situation.i have tried this situation and what happens in this case is that a small window pops up saying that "cannot open filename.exe",but no exception is generated.
please tell me as to how can i catch an exception that is generated when the executable is not present in the dir or for some reason it fails to start.would appreciate your help a lot..
thanks a lot
karan
16 years ago
hi there,
i have servlet running on the server and the client communicates with the servlet to run an executable file on the server which in turns produces some output files on the server in some particular directory.now my question is the following:
the generation of the output files on the server is a proof of the fact that the executable file has run successfully on the server.now once the files are generated successfully i want to let the client know that the executable has run successfully and the files are generated.so can you please suggest me any ideas how can i do this?i know how to send an object to the frame from the servlet,but i need to test for some condition in the servlet before i send a string back to the frame from the servlet and depending upon that condition the string that is sent will be either "successful" or "unsuccessful".
i am using Runtime.getRuntime().exec(cmd) to run the executable on the server,but how do i check if this has executed correctly and hence send the "successful" string to the client or "unsuccessful" if it has not executed successfully?
any ideas would be appreciated..
cheers and thanks
karan
16 years ago
hi cindy,
thanks for such a prompt reply..i am sorry but i didnt quite understand what u said i nthe following statements:
"You can just bundle the java code with your application code, and when you invoke the application you use the -cp option to dynamically name the classpath to find the java class files. Of course you will also need to dynamically tinker with the path parameter to tack on the directory that has the java.exe stuff in it. "
what i have right now are some java source files thats it,so whenever i run my GUI i go to the command prompt and type "java mainfilename" and my main frame pops up.of course i can write this command("java mainfilename") in a batch file and make an icon for it for the user to click and start it but again for the frame to open,there has to be javan in the user's computer right?i mean there has to be java.exe somewhere in the users computer and its path should be set in the system environment of the users computer,right?
is there no way by which i can probably make some executable file of my java source files so that the user just have to double click that executable file in order to start my application and without having to install java in his computer?
appreciate ur help in this matter..
cheers
karan
16 years ago
hi there,
i have a couple of java source files and i was wondering if any of you folks could tell me how to make a standalone application from these source files that i can install on any computer without having to install java in that computer.the main page(the front screen of the application) is a java frame,and i am calling various other java files from this frame.
would really appreciate it,its kinda urgent.
thanks in advance
karan
16 years ago
hi there,
i have a couple of java source files and i was wondering if any of you folks could tell me how to make a standalone application from these source files that i can install on any computer without having to install java in that computer.the main page(the front screen of the application) is a java frame,and i am calling various other java files from this frame.
would really appreciate it,its kinda urgent.
thanks in advance
karan
16 years ago

Originally posted by Shubhrajit Chatterjee:
Your batch file should look like this


And then use runtime.exec()


hi there,
thanks a lot for all your help guys..now the application is working,javaranch di it again!!keep up the good work!!
cheers
karan
16 years ago
hi william,
you were absolutely right in saying that the C++ executable has a dependency on the current working dir and it assumes the current working dir to be different than what it actually should be,i realised this just now when i tried to run the C++ executable from the client machine itself but not by double clicking it but by calling it frmo the java interface,now also the executable requires the input files to be in some different dir than the one in which itslef is.and the output files are also generated in that dir(ie dofferent than the dir of the executable file).
so please tell me what should i do,as in what were you saying about making a batch file.please tell me what should i write in the batch file,right now i have just written the following in the batch file
C:\foo\C++executable.exe
but on running this batch file on the client machine from the java interface the output files are generated in different dir and not in the same dir as the C++ executable file.so what more should i write in the batch file?please help me out..would appreciate it..
thanks a ton in advance
karan
16 years ago
hi william,
thanx for replying to my query..well i have indeed tried your batch file suggestion,ie,i created a batch file in which i wrote pathofthedir\filename.exe thats it.bit ihad the same problem,ie,the files were being read from the bin dir of tomcat only and the output files were generated in the bin dir of tomcat.i didnt quite understand what u meant when u said the following:
"The exec process is very flexible so you could substitute target directories into the batch file, giving different directories for different users"
can u please elaborate on it.qould really appreciate it.
thanks a lot
karan
16 years ago
i was thinking that maybe we can modify the config files of tomcat or something..is that possible?
take it easy
karan
16 years ago