Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 30th, 2012, 12:33 AM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
Java Executable Jar problem

Hi, I am new, and trying to do my best to learn java and avoiding making questions, everything went pretty good until now, I have created a lot of little programs. I now designed a screen saver, the "biggest" thing I have made, but always wanted to save as runnable programs, because I always erase the programs when started a new one, but I don't want to erase this one cause actually I appreciate my effort into it. I have tried a lot to create a runnable jar file, do it with eclipse and didn't work, search on google and told me about this manifest thing which I don't understand, someone told me to try with netbeans, I tried with the clear and build option, and the same thing as eclipse. I got my icon of the jar, I click it, the loading box of java and oracle appears, and after some seconds it tolds me this errors

Exception:

MissingFieldException[ Falta el siguiente campo requerido del archivo de inicio: <jnlp>]\\translation: the next required field of the initial file (something tells me archivo de inicio = initial file is the main file) is missing
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)

also there is this thing of archivo de inicio (guessing this is main class) that has a lot of unknown simbols: �@

If you need more information in order to help me I will try to look for what you are asking (I don't think I find something more because I have already post all I know). I have a week trying to solve this and haven't success, I really need it to work.

Sorry for my bad english.

Reply With Quote
  #2  
Old April 30th, 2012, 05:33 AM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
Can you open a command prompt, change to the directory with the jar file and enter:
java -jar <THEJARFILENAME>.jar
and copy the contents of the command prompt window and paste it 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.

Reply With Quote
  #3  
Old April 30th, 2012, 11:19 AM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
...I already do it, but it doesn't said anything, it just run the program perfectly and that's it, but if I click the icon on my documents it still doesn't work.

edit: just in case
C:\Users\Carlos\Documents\NetBeansProjects\JavaApplication1\dist

30/04/2012 12:01 a.m. <DIR> .
30/04/2012 12:01 a.m. <DIR> ..
30/04/2012 12:01 a.m. 37,352 JavaApplication1.jar
30/04/2012 12:01 a.m. 1,332 README.TXT
2 archivos 38,684 bytes
2 dirs 102,855,000,064 bytes libres

C:\Users\Carlos\Documents\NetBeansProjects\JavaApplication1\dist>java -jar JavaA
pplication1.jar

C:\Users\Carlos\Documents\NetBeansProjects\JavaApplication1\dist>

Reply With Quote
  #4  
Old April 30th, 2012, 11:42 AM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
If you can manually execute the jar, then the jar file's contents must be OK.

The problem must be with the OS not executing the correct command when you double click on the jar file.


Have you tried copying the jar file to a test folder and executing it manually to be sure that there are no files it is using in the dist folder?

Last edited by NormR : April 30th, 2012 at 11:45 AM.

Reply With Quote
  #5  
Old April 30th, 2012, 12:10 PM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
I created a folder named test folder, and copy it there, it doesn't work. Well I don't think I did it correctly, I just try what I thought it might work, cause I have some doubts, were do I put the folder and how do I open it manually (do I just give it double click?)

Reply With Quote
  #6  
Old April 30th, 2012, 12:17 PM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
Can you copy the console of the command prompt window and paste it here?
Quote:
how do I open it manually

See post#2 & post#3

Reply With Quote
  #7  
Old April 30th, 2012, 12:37 PM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by NormR
Can you copy the console of the command prompt window and paste it here?

See post#2 & post#3


this?

Directorio de C:\Users\Carlos\Documents\NetBeansProjects\Test folder

30/04/2012 11:56 a.m. <DIR> .
30/04/2012 11:56 a.m. <DIR> ..
30/04/2012 12:01 a.m. 37,352 JavaApplication1.jar
1 archivos 37,352 bytes
2 dirs 104,009,740,288 bytes libres

C:\Users\Carlos\Documents\NetBeansProjects\Test folder>java -jar JavaApplication
1.jar

C:\Users\Carlos\Documents\NetBeansProjects\Test folder>

Reply With Quote
  #8  
Old April 30th, 2012, 12:48 PM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
That looks like the jar file executed OK.

Reply With Quote
  #9  
Old April 30th, 2012, 12:54 PM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
It is actually working great in any file with the command promt but if I get out of there and double click it in the file it still don't work, the same as the dist file :/, how can I open it with double click?

Reply With Quote
  #10  
Old April 30th, 2012, 01:56 PM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
You need to fix something in the OS so it uses the correct command line when it tries to open the jar file. There is an entry in the Windows Registry that contains the command the OS uses. If it is not coded correctly opening the jar file will fail.
Do a Google for instructions on how to use the regedit program to look in the registry. It may be some thing that you can fix.


Do you have any other jar files? Can you open any of them by double-clicking?

Reply With Quote
  #11  
Old April 30th, 2012, 03:01 PM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
I have downloaded two programs, one didn't work, the same as my programs, and the other runned perfectly. (also applets runs pretty well).

About regedit I use windows key + r to look for it and open it, there are a lot of folders and files but don't know what to look.
I use this information by the way: http://www.techsupportalert.com/content/learn-how-use-windows-registry-editor-regedit-one-easy-lesson.htm I didn't knew a thing of regedit.

Reply With Quote
  #12  
Old April 30th, 2012, 03:25 PM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
Was there any jar file that worked when you double-clicked on it?
Applets are different, they don't use the OS and registry the same way.

Reply With Quote
  #13  
Old April 30th, 2012, 04:00 PM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
Quote:
I have downloaded two programs, one didn't work, the same as my programs, and the other runned perfectly.

those two were jar, one worked the other didn't

Reply With Quote
  #14  
Old April 30th, 2012, 04:28 PM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
If any of them worked, then the registry is probably OK.

Do you have more than one version of java on your system? Could the JDK be version 1.7 and the JRE be version 1.6? If the jar file has version 1.7 class files, a version 1.6 JRE will not be able to execute it.

Reply With Quote
  #15  
Old May 1st, 2012, 09:54 AM
MrChearlie MrChearlie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 22 MrChearlie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 47 sec
Reputation Power: 0
How can I check that?, also, if there that is thruth, how do I fix it, I just re-download the JDK (cause the JRE I re-download it yesterday trying to see if that was the problem) or I have to unninstall it first?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Java Executable Jar problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap