• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

jar in Jdk 1.7

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How run jar file using jdk 1.7. and When i run simple program HelloWorld.java run through command-prompt then compiler show at runtime could not load main class. Tell me solution.

Thanks in advance
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Please show us your code and tell us the exact commands that you are using to compile and run your application. Right now you haven't given us enough details to tell you exactly what's wrong.
 
Khushdeep Singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir, My old jar file which i created through Eclipse and netbean and new created jar files not run. but code is running in eclipse and netbean.

When i click on created jar file . then it generate pop window which show error: unable to launch application.


when i click on details then it show....

MissingFieldException[ The following required field is missing from the launch file: <jnlp>]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Khushdeep Singh wrote:How run...



Please don't abuse colors like that.

It makes your post hard to read. Only use color sparingly for highlighting or correlating small amounts of text.

Thanks!
 
Marshal
Posts: 68061
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeff Verdegan wrote: . . . Please don't abuse colors like that. . . .

I have got rid of the green from the text.
 
Campbell Ritchie
Marshal
Posts: 68061
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what is in the manifest file in your .jar?
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to run the application as a Java Web Start application?
 
Khushdeep Singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My manifest file contain....

Manifest-Version: 1.0
Class-Path: . Reader_lib/poi-3.7-20101029.jar Reader_lib/itextpdf-5.1.
3.jar
Main-Class: DateReaderMain

where DateReaderMain is main class.


and i run this application as Java Application.

This application work in eclipse. but when i create jar file of this application through eclipse but jar file not working. Even my old jar files which working on old version of jdk 1.6 . but not working on jdk 1.7.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exact command that you are typing in on the command prompt to start the application?

Is your DateReaderMain class not in a package?
 
Campbell Ritchie
Marshal
Posts: 68061
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and I presume by the blank line in your post that you have a blank line at the end of the manifest file; that blank line is necessary.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stack trace that you posted indicates that you're trying to run the application via Java Web Start.

Khushdeep Singh wrote:MissingFieldException[ The following required field is missing from the launch file: <jnlp>]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 
Their achilles heel is the noogie! Give them noogies tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!