when i tried to run jar file from netbeans it works fine but when i try to run by command prompt it gives me exexeption in thread error but when i check my task manager it shows the javaw.exe is running..............what it exactly and why this error comes only in command prompt?
compile your application with:
>javac -jar example.jar ClassName.java
Run:
>java -jar example.jar ClassName
Can you please paste the exception that you get.
When running from command line, you have make sure that classpath for your program is set properly.
Make user that you have set the main-class in your manifest file of you jar.
Related
I am currently attempting to use FileZilla Pro CLI on a Windows machine to connect and upload to a site in that is working in the Site Manager.
The issue is, the command below works perfectly when pasting it directly into the cmd line. However when saving it as a batch file, it simply just gets to the fzcli> prompt and then nothing happens.
The two line breaks are on purposes to override the requirement for a password and it works perfectly when pasted in.
Does anyone know if this is a cmd line issue, or if my commands need to be different to work in batch file mode?
fzcli
connect --site 0testsite01
put C:/inetpub/wwwroot/websites/sftp/files/customer/test-01.txt /test-sftp/testuser01/test/test-01-uploaded.txt
PAUSE
Your batch file executes fzcli in an interactive mode. The fzcli then waits for you to interactively enter the commands. Only after you would exit the fzcli, the batch file would continue. And fail, as it will try to execute connect as a batch file command. The fzcli does not know about the batch file. Nor does the batch file interpreter know about the fzcli commands.
It's a common misconception. You will find plenty of similar questions basically about scripting any tool that has its own commands. For example: sftp, ftp, psftp, winscp.
To provide commands to fzcli, it seems that you need to use --script switch. The fzcli documentation gives this example:
fzcli --mode standalone --script C:\Scripts\script-file
I tried to execute the below command from Jenkins, and I got below error. I tried to print the command and executed the same command through cmd.exe and it runs successfully. I checked the folder permission and it is having the write permission. I ran jenkins using war file and saw it is executing under the same user as cmd.exe is running
Command that is executed on both jenkins and cmd.exe is,
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "d:\jenkins\workspace\NewTestItem\App\abc.sln" /t:rebuild /p:PackageLocation=d:\jenkins\workspace\NewTestItem\iisPackageDeploymentDir\26\ /p:DeployOnBuild=True /p:Configuration=Release /m /v:d /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
Error which I am getting in jenkins
Microsoft.Common.CurrentVersion.targets(3821,5): error MSB3021: Unable to copy file "d:\jenkins\workspace\NewTestItem\App\mgmt\UserGuide\US\help.pdf" to "bin\mgmt\UserGuide\US\help.pdf". Access to the path 'bin\mgmt\UserGuide\US\help.pdf' is denied.
Note : Solution contains multiple project
I'm try to create a batch file that will, among other things like installing the newest version of our software, first UNINSTALL the old version. I have used "wmic product get name" to find the actual name of the program, and then I have scripted the following code to uninstall the program:
wmic product where "name like 'Borland CaliberRM 10.1'" call uninstall /nointeractive >> C:\users\pbrandvold\Desktop\log.txt
When it's finished, I get this message:
Executing (\\PHIL-BRANDVOLD\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{ED8B0A1F-8E90-478A-82B6-7C885A628257}",Name="Borland CaliberRM 10.1",Version="10.1.0.84")->Uninstall()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
ReturnValue = 1603;
};
I can't think of what is happening - why won't this uninstall? I've also tried using the msi, and running:
msiexec.exe /qn /x "Borland CaliberRM 10.1.msi"
Which doesn't work either.
I had this issue when trying to uninstall and reinstall Web Deploy using wmic via a batch file. It did not help running the batch file with elevated privileges.
The only way I could get it to run correctly was to open a Command Prompt window with elevated privileges and run the batch file through that.
The solution I ended up going with was to turn my batch file into an executable using a Bat to Exe converter. http://www.f2ko.de/en/b2e.php
The issue occurs due to the user's privileged of uninstalling the program.
Just open the command prompt as 'Run as administrator and run your command to uninstall the program.
Example :
open cmd with admin:
run below commands
wmic
product get name
product where name="YOUR_PROGRAM_NAME" call uninstall
I am tryng to run a java application in a container. In my docker file I copy the jar file and then run the jar
ADD project.jar /tmp/project.jar
CMD java -jar /tmp/project.jar
This fails with the following error Error: Unable to access jarfile /tmp/projct.jar However if I run the image with bash and manually navigate t o /tmp and run the java -jar command it works. Are there any more configurations I need to follow?
I try to prepare bat file to sign apk file with signapk.jar
The syntax of this program is:
java -jar signapk.jar testkey.x509.pem testkey.pk8 <update.apk> <update_signed.apk>
My script looks like this:
java -jar "%~dp0%\SignApk\signapk.jar" "%~dp0%\SignApk\testkey.x509.pem" "%~dp0%\SignApk\testkey.pk8" "%~dp0%\SignApk\%ApkName%.apk" "%~dp0%\SignApk\%ApkName%_sign.apk"
When I execute the script I receive a message "Unable to access jarfile {update_signed.apk}", java "thinks" that is also a jar file and tries to run it..
Someone can help me how to pass arguments to jar file ?
Thanks.
The -jar variant of the Java command line does only process a single JAR file, so your error message is not related to that.
Your error message is most likely created by the signapk application: You should try the direct command (with no batch wrapper, without the argument variables and especially without special characters or space in the path or the arguments or relative naming - do a cd into the SignApk dir first).
If that works, you can work backwards to find where the escaping has failed you.
BTW: if this is the tool, you need to specify a sign command as well:
java -jar signapk.jar -c sign.pem -k sign.p8 sign your.apk