Error 193 Java Exception
Contents |
This Site Careers Other all forums Forum: Java in General createProcess error=193, %1 is not a valid windows error 193 java vm win 32 application syed vaseem Greenhorn Posts: 6
Java Createprocess Error 193
posted 5 years ago Error:Cannot run program "C:\Users\x\Desktop\jannotatix.jar" (in directory "C:\Users\x\Desktop"); createProcess error=193, %1 createprocess error=193, %1 is not a valid win32 application java is not a valid win32 application. This above error i am getting when i select a jar file from the path mentioned above but
Createprocess Error=193 1 Is Not A Valid Win32 Application Maven
it's working fine with exe files, i am able to execute successfully exe files but when i try to do for jar files the above mentioned error i get... please help me out asap. This is my part of project which is used to calculate time n memory jenkins createprocess error=193, %1 is not a valid win32 application used to execute an exe file and jar file. Here goes the code.... package gui; import java.io.PrintStream; import javax.swing.*; import javax.swing.filechooser.FileSystemView; import java.io.File; public class ExecutableAnalyzer { public long getRunningTime(String filename) { long startTime,endTime,exetime; Runtime r = Runtime.getRuntime(); Process p = null; String command; FileSystemView filesys = FileSystemView.getFileSystemView(); File[] roots = filesys.getRoots(); filesys.getHomeDirectory(); int extension_index=filename.lastIndexOf('.'); String extension=filename.substring(extension_index); JOptionPane.showMessageDialog(null,filesys.getHomeDirectory()); File dir = new File(filesys.getHomeDirectory().toString()); if(extension.equalsIgnoreCase("jar")) { command="java -jar "+filename; } else { command=filename; } startTime=System.currentTimeMillis(); try { JOptionPane.showMessageDialog(null,command); p = r.exec(command,null,dir); p.waitFor(); } catch(Exception e) { JOptionPane.showMessageDialog(null,"Error:"+e.getMessage()); } endTime=System.currentTimeMillis(); exetime=endTime-startTime; return exetime; } public long getMemory(String filename) { long usedmemory; Runtime r = Runtime.getRuntime(); Process p = null; String command; File dir = new File("C:\\"); int extension_index=filename.lastIndexOf('.'); String extension=filename.substring(extension_index); if(extension.equalsIgnoreCase("jar")) { command="java -jar "+filename; } else { command=filename; } try { p = r.exec(command,null,dir); p.waitFor(); } catch(Exception e) { JOptionPane.showMessageDialog(null,"Error:"+e.getMessage()); } usedmemory=r.totalMemory()-r.freeMem
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Java.io.ioexception Createprocess Error=193 1 Is Not A Valid Win32 Application
policies of this site About Us Learn more about Stack Overflow the company
Shellexecute Java
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users createprocess error=193 1 is not a valid win32 application python Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a https://coderanch.com/t/536837/java/java/createProcess-error-valid-win-application minute: Sign up Running .jar in Java up vote 0 down vote favorite I want to run a .jar file in Java, but I get an exception and it doesn't work. In the directory C:/Users/Administrator/Desktop/apache-solr-4.0.0/example, I have a file called start.jar. My last example this, but it throws an exception. What do I have to do in order to fix it? http://stackoverflow.com/questions/13681374/running-jar-in-java public void runStart() { try { Runtime rt = Runtime.getRuntime(); Process p = rt.exec("C:\\Users\\Administrator\\Desktop\\apache-solr-4.0.0\\example\\start.jar"); } catch (IOException ex) { Logger.getLogger(SolrForm.class.getName()).log(Level.SEVERE, null, ex); } } java exception jar share|improve this question edited Dec 3 '12 at 10:50 MC Emperor 4,02573675 asked Dec 3 '12 at 10:32 user527 85314 1 what is the error? Post stacktrace.. –Nandkumar Tekale Dec 3 '12 at 10:33 java.io.IOException: Cannot run program "C:\Users\Administrator\Desktop\apache-solr-4.0.0\example\start.jar": CreateProcess error=193, %1 is not a valid Win32 application at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) –user527 Dec 3 '12 at 10:34 you should run it as a java app not as an .exe –wxyz Dec 3 '12 at 10:34 add a comment| 4 Answers 4 active oldest votes up vote 3 down vote You need to exec with java -jar in the command line, otherwise you're not really executing anything. e.g. rt.exec("java -jar myjar.jar"); Oh, and you'll need to wait for the process to finish; otherwise it may get terminated unexpectedly when it drops out of scope. share|improve this answer edited Dec 3 '12 at 10:46 MC Emperor 4,02573675 answered Dec 3 '12 at 10:34 Jef
error=193, %1 is not a valid Win32 application Summary: java.io.IOException: https://netbeans.org/bugzilla/show_bug.cgi?id=158761 CreateProcess error=193, %1 is not a valid Win32 applica... Status: RESOLVED FIXED Product: php Classification: Unclassified Component: PHPUnit Version: 6.x Hardware: All All Priority: P3 (vote) TargetMilestone: http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/tec1210709.aspx 6.x Assigned To: Tomas Mysik QA Contact: issues@php URL: http://statistics.netbeans.org/except... Whiteboard: EXCEPTIONS_REPORT Keywords: Depends on: Blocks: Show dependency tree /graph Reported: 2009-02-18 17:00 UTC by createprocess error Exceptions Reporter Modified: 2009-05-14 08:40 UTC (History) CC List: 7 users (show) abajja fortruth kldamr kolen phejl purnama tprochazka See Also: Issue Type: DEFECT Exception Report : Attachments stacktrace (1.22 KB, text/plain) 2009-02-18 17:00 UTC, Exceptions Reporter Details stacktrace (1.27 KB, text/plain) 2009-02-19 10:34 UTC, tprochazka Details stacktrace (1.21 KB, text/plain) 2009-04-02 15:44 is not a UTC, abajja Details stacktrace (1.20 KB, text/plain) 2009-04-17 10:38 UTC, abajja Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Exceptions Reporter 2009-02-18 17:00:16 UTC Build: NetBeans IDE Dev (Build 2009-02-18_12-46-28) VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Windows XP, 5.1, x86 User Comments: GUEST: I was setting phpunit script in netbeans because it was not found. I use xampplite in windows buzzword: Opened Tools->Options for PHP configuration options. GUEST: I was setting phpunit script in netbeans because it was not found. I use xampplite in windows Stacktrace: java.io.IOException: Cannot run program ""D:\Program Files\xampplite\php\phpunit"": CreateProcess error=193, %1 is not a valid Win32 application at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at org.netbeans.api.extexecution.ExternalProcessBuilder.call(ExternalProcessBuilder.java:288) at org.netbeans.api.extexecution.ExternalProcessBuilder.call(ExternalProcessBuilder.java:70) at org.netbeans.api.extexecution.ExecutionService$3.call(ExecutionService.java:254) at org.netbeans.api.extexecution.ExecutionService$3.call(ExecutionService.java:230) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) Comment 1 Exceptions Reporter 2009-02-18 17:00:29 UTC Created attachment 77115 [details] stacktrace Comment 2 tprochazka 2009-02-19 10:34:54 UTC Build: NetBeans IDE
productResults.length + resourceResults.length > 0 ? 'See all Search Results' : 'Full site search'}} > > CA Support Online > Support by Product > Support by Product Error: "Creation of CDB failed java.lang.Exception: java.io.IOException:" When Running The Installation Of Service Desk Management Document ID:TEC1210709 Last Modified Date:03/11/2016 {{active ? 'Hide' : 'Show'}} Technical Document Details Products CA Service Desk Manager Releases CA Service Desk Manager:Release:14.1 Components Svc Desk Database:SDDB Problem: The following error occurs during the installation of CA Service Desk Management: [InstallCDB] Creation of CDB failedjava.lang.Exception: java.io.IOException: Cannot run program ""F:\\scripts\CDB\setupmdb.bat"" (in directory "F:\scripts\CDB"): CreateProcess error=193, %1 is not a valid Win32 applicationat com.ca.smsi.installui.tasks.InstallCDB.executeCommand(InstallCDB.java:421)at com.ca.smsi.installui.tasks.InstallCDB.installDatabase(InstallCDB.java:180)at com.ca.smsi.installui.tasks.InstallCDB.run(InstallCDB.java:44)at com.ca.smsi.wizard.task.Task.start(Task.java:222)at com.ca.smsi.installcore.DeployThread.run(DeployThread.java:455)Caused by: java.io.IOException: Cannot run program ""F:\\scripts\CDB\setupmdb.bat"" (in directory "F:\scripts\CDB"): CreateProcess error=193, %1 is not a valid Win32 applicationat java.lang.ProcessBuilder.start(Unknown Source)at java.lang.Runtime.exec(Unknown Source)at java.lang.Runtime.exec(Unknown Source)at com.ca.smsi.installui.tasks.InstallCDB.executeCommand(InstallCDB.java:405)... 4 moreCaused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 applicationat java.lang.ProcessImpl.create(Native Method)at java.lang.ProcessImpl.