0

Hello:
I tried to create the jar of a project on C drive I have these command with the error.
Could someone help with the creation of the jar?

command
f

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf

path to manifest.txt

C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_master\guitar_master\build\classes\view myManifest.txt

intended gm.jar denied on c: and outside of project

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf

???????????????????????????????????????NOte: path to c drive did not work?????????????????????????
C:\Users\depot\.gmHome\source\application gm.jar
?????????????????????????????????????????????

new path:
C:\Users\depot\Documents\ceyesumma\java_cache\my_projects gm.jar

path to project

C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_master

final command

jar -cvmf C:\Users\depot\Documents\ceyesumma\java_cache\my_projects gm.jar 

C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_master\guitar_master\build\classes\view myManifest.txt 

C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_master

error

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf C:\Users\depot\Documents\ceyesum
ma\java_cache\my_projects gm.jar C:\Users\depot\Documents\ceyesumma\java_cache\m
y_projects\guitar_master_project\target_guitar_master\guitar_master\guitar_maste
r\build\classes\view myManifest.txt C:\Users\depot\Documents\ceyesumma\java_cach
e\my_projects\guitar_master_project\target_guitar_master\guitar_master
java.io.FileNotFoundException: C:\Users\depot\Documents\ceyesumma\java_cache\my_
projects (Access is denied)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileInputStream.<init>(FileInputStream.java:66)
        at sun.tools.jar.Main.run(Main.java:131)
        at sun.tools.jar.Main.main(Main.java:1022)

C:\Program Files\Java\jdk1.6.0_11\bin>
C:\Program Files\Java\jdk1.6.0_11\bin>

_______________________________________________________________________________________________________
************************************************ xxxxxxxxxxxxxx above *******************************************************
_______________________________________________________________________________________________________________________________

2
Contributors
1
Reply
5
Views
7 Years
Discussion Span
Last Post by NormR1
0

A question about your technique:
Why are you in the JDK's bin folder vs in the folder with the parts to build your jar file?
Add the JDK's bin folder to the PATH environment variable.

Check the order of the jar command options with the order of the files on the commmandline.
You have: jar -cvmf manifest then jar file
but on the commandline the jar is first?

Here's a sample from a batch file that works for me:
jar -cmf ScreenCapturer.mnf %JarName% *.class

Edited by NormR1: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.