Results 1 to 9 of 9
Thread: Create .JAR
- 08-01-2012, 12:45 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 10
- Rep Power
- 0
Create .JAR
Hi all i've this situation
Main class is located into "matsrc" directory.Java Code:- C:\ - javagraf MANIFEST.txt - hofstra - matsrc *.class - expr *.class
I want to creare .jar file in "javagraf" directory.
My MANIFEST:
Manifest-Version: 1.0
Created-By: XXX
Main-Class: hofstra\matscr\mainClass.classcd C:\javafagrafI've tryed with:jar cmf MANIFEST.txt MyJar.jar ???
but it don't work.jar cmf MANIFEST.txt MyJar.jar hofstra\matscr\*.class hofstra\matscr\expr\*.class
Where is the problem?Last edited by DarrylBurke; 08-02-2012 at 04:44 PM. Reason: Solved
- 08-01-2012, 12:58 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Create .JAR
Just use the directory name.
Please do not ask for code as refusal often offends.
- 08-01-2012, 02:27 PM #3
Member
- Join Date
- Jul 2012
- Posts
- 10
- Rep Power
- 0
Re: Create .JAR
- 08-01-2012, 02:30 PM #4
Re: Create .JAR
What error message do you get? Open a command prompt window, change to the folder with the jar file and enter:
java -jar MyJar.jar
copy the console contents here.
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.If you don't understand my response, don't ignore it, ask a question.
- 08-01-2012, 03:10 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
- 08-01-2012, 03:47 PM #6
Member
- Join Date
- Jul 2012
- Posts
- 10
- Rep Power
- 0
Re: Create .JAR
C:\javagrafzip>jar cmf MANIFEST.txt MyJar.jar hofstra (as Tolls suggest)
At now jar size is 66KB so i suppose that it is consistent.
C:\javagrafzip>java -jar MyJar.jar
Errore: impossibile trovare o caricare la classe principale Graf.class
Error: can't find or load main class Graf.class [eng]
I've tryed to modify my MANIFEST's main class row as:
orMain-Class: Graf.class
orMain-Class: hofstra\matscr\mainClass.class
I've also tryed to change MANIFEST's extension as .MF (as some guides suggest)Main-Class: hofstra.matscr.mainClass.class
result is the same: "can't find or load main class".
- 08-01-2012, 03:55 PM #7
Re: Create .JAR
Look in the jar file with a zip utulity and see what the path to the Graf.class file is.
Is the Graf class in a package? If so, that is where the class file needs to be and that is what needs to be on the Main-Class: entry.If you don't understand my response, don't ignore it, ask a question.
- 08-01-2012, 04:11 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Create .JAR
The classname does not have the file extension on the end.
No '.class'.
And, as Norm says, should contain the full package name (with '.', not path separators).Please do not ask for code as refusal often offends.
- 08-02-2012, 02:46 PM #9
Member
- Join Date
- Jul 2012
- Posts
- 10
- Rep Power
- 0
Similar Threads
-
Help me create this GUI please
By atrodeyo in forum AWT / SwingReplies: 8Last Post: 04-26-2012, 05:32 PM -
How to create a JFrame window and create a circle.
By tehsumo in forum AWT / SwingReplies: 3Last Post: 02-27-2012, 04:06 PM -
create id
By daisy in forum JDBCReplies: 15Last Post: 03-16-2011, 09:34 AM -
jsp to create xml
By mcajavaprogramer in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-05-2010, 12:22 PM -
Create XML From XSD
By Jack in forum XMLReplies: 1Last Post: 07-09-2007, 12:56 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks