I am new to Java programming. I have a batch file called StartSample.bat. This batch file launches a java program. This is the code for the batch file:
@echo off
set CLASSPATH=%CLASSPATH%;f3bc4jav.jar
set CLASSPATH=%CLASSPATH%;PalmSecureSample_Java.jar
@echo on
java <classname>
The .jar files mentioned above are located in the same folder as the batch file.
When I run StartSample.bat, it runs the Java Program in the same way as it should.
Now, what I did, I created a Java Class to run this batch file using this code:
Process p = Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\cmd.exe /c start C:\\Identify\\dll\\StartSample.bat");
Error starting my code. Error:
C:workspace\Project>java <classname> Error: Could not find or load main class <classname>
What is the problem?
source
share