Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Denny's DVD application is not running?

 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a jar of the project and when I try to type the command "javaw -jar sampleproject.jar alone"
and run it...
it is not working..
kindly help me..
Thanks in advance
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please TellTheDetails

Did you build an executable jar. Which exception do you get?
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I made a JAR for the project..
But, when I try to use the command "javaw -jar sampleproject.jar " and run it.
It is running.
By the way, I'm not getting exceptions..

Following is the command prompt status, when I run the command


E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar alone

E:\SCJD\denny's DVD src code\2563>
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes it any difference if you use the java command to start the jar?

So you say "it's running" but "it's not working". What's wrong? Which part is not working? It's impossible to help you if you don't provide more information, please TellTheDetails.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel also asked if you made an executable jar - not just any jar, but one that you have explicitly told the jar command that the resultant file should be executable.

Perhaps you could show us the command line you used to create the jar file?
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not providing enough information.

Below are the commands I run on the 'CMD'.


"C:\Users\Paul_E>E:

E:\>E:\SCJD\denny's DVD src code\2563
'E:\SCJD\denny's' is not recognized as an internal or external command,
operable program or batch file.

E:\>cd E:\SCJD\denny's DVD src code\2563

E:\SCJD\denny's DVD src code\2563>set path=C:\Program Files\Java\jdk1.7.0_05\bin


E:\SCJD\denny's DVD src code\2563>javac -d classes sampleproject\db\*.java

E:\SCJD\denny's DVD src code\2563>javac -d classes sampleproject\remote\*.java

E:\SCJD\denny's DVD src code\2563>javac -d classes sampleproject\sockets\*.java

E:\SCJD\denny's DVD src code\2563>javac -d classes sampleproject\gui\*.java

E:\SCJD\denny's DVD src code\2563>jar -cfm sampleproject.jar Manifest.mf -C cla
sses .

E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar alone

E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar

E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar server

E:\SCJD\denny's DVD src code\2563>"


Could this help?
Or Am I missing something?
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be very helpful, why we use the parameter '-cfm', when we create the '.jar' file?

By the way

"E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar alone

E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar

E:\SCJD\denny's DVD src code\2563>javaw -jar sampleproject.jar server "

These 3 commands, produce nothing.

Thanks in advance
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you create a Manifest.MF file where you set the main class of the application? That's the class containing the main method (which should be executed when the jar is executed).
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Palraj Jayaraj wrote:why we use the parameter '-cfm', when we create the '.jar' file?

Have a look at the documentation of the jar tool for more information about these options.
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I created the MANIFEST.mf file in the "2563" folder and it's content is:

"Manifest-Version: 1.0
Main-Class: sampleproject.gui.ApplicationRunner"
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have a 2563/MANIFEST.MF file?! It should be META-INF/MANIFEST.MF.
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you describe the structure of your jar file? And also show the content of the manifest.mf file in your jar.
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too have a "MANIFEST.mf"under that "meta-inf" folder.

it's content:

"Manifest-Version: 1.0
Created-By: 1.7.0_05 (Oracle Corporation)
Main-Class: sampleproject.gui.ApplicationRunner"
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Roel:" sorry, I don't understand..
Structure in the sense?

the content of the Manifest.mf file in the jar is
<i>"Manifest-Version: 1.0
Created-By: 1.7.0_05 (Oracle Corporation)</i>
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which directories do you have in your jar.

Palraj Jayaraj wrote:the content of the Manifest.mf file in the jar is
"Manifest-Version: 1.0
Created-By: 1.7.0_05 (Oracle Corporation)

That explains why nothing is happening: you don't have a Main-Class entry, so java doesn't know which class it has to start from the jar
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you find valuable information about creating the jar with the manifest.mf file and possible pitfalls where you have to be careful with.
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roel and Andrew,
the problem with the Manifest.mf file is that I forgot tp press enter after I typed in that file

Now, I'm able to run it
 
Roel De Nijs
Sheriff
Posts: 10603
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to hear you were able to solve it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic