Results 1 to 6 of 6
I have made an application in java and then made a jar out of it. This jar is actually made automatically by netbeans ide when the project is built. In ...
- 11-07-2008 #1Just Joined!
- Join Date
- Sep 2005
- Posts
- 99
running a jar file in linux
I have made an application in java and then made a jar out of it. This jar is actually made automatically by netbeans ide when the project is built. In windows if you double click on the jar file it just runs. However, in linux when i double click on the jar file it says the application can't load. The details of the error message are:
I don't think i did any of the programming wrong or made the manifest file wrong because it works on windows machines. Is there some formatting deal in an xml file somewhere that is preventing it from running? Thanks.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.buildDescript or(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescript or(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)
- 11-07-2008 #2
Have you tried running it from command line?
Try that and see what errors you get. As for your xml file, the jnlp error seems to imply that you're doing something with java web start. Do you have a jnlp tag in a target file to run that somewhere?Code:java -jar jarfile
Registered Linux User: #479567
Asking a question? Read this page first.
Now... sudo make me a sandwich.
ratiocinativeroot.blogspot.com
- 11-08-2008 #3Just Joined!
- Join Date
- Sep 2005
- Posts
- 99
yea i tried that and it works but it doesn't work right. Part of the program reads in files and i think linux reads in files in a different order then windows does. The file names are 1.cfg, 2.cfg, 3.cfg, etc up to 9.cfg. In windows it reads them as expected 1, 2, 3, etc up to 9 but linux seems to read them in a random order or something. It appears to be the same order every time but it seems to jump around the numbers. Its not even like it starts at 5.cfg and then goes to 6, 7, 8, 9, its like it jumps around them. Thus the program doesn't work right. I thought java was a write once, use anywhere thing so whats the deal here?
- 11-08-2008 #4
How are you reading in the files? Do you have the file names statically in your program, like:
And then operating on each, or are you reading them in as command line arguments or something? Is your relevant code small enough to post here?Code:String array[]= {"1.cfg","2.cfg","3.cfg","4.cfg" ... };Registered Linux User: #479567
Asking a question? Read this page first.
Now... sudo make me a sandwich.
ratiocinativeroot.blogspot.com
- 11-09-2008 #5Just Joined!
- Join Date
- Sep 2005
- Posts
- 99
there are 2 folders, each have 9 cfg files. To open them i pass in the folder name and then i look at all the files in that folder and 1 file at a time loop through all the lines and take the info out. So basically this shows it.
Each team has a folder so i create a file called teamFolder and this is the folder name that holds the cfg files. Then i create an array of File based on the list of files in this folder. Then i loop through this array of File calling the constructor of the Player class which parses through each individual cfg file taking the info that is needed.Code:File teamFolder = new File(teamName); File playerFiles[] = teamFolder.listFiles(); for(int i=0; i < playerFiles.length; i++) { if(playerFiles[i].isFile()) { players[i] = new Player(playerFiles[i].toString()); } // end if } // end for
- 02-04-2009 #6Just Joined!
- Join Date
- Feb 2009
- Posts
- 1
How to create Jar or Ear or War in Linux or Unix
Hi All,
please help me to create EAR files.
How to Create Jar or War or Ear files for java projects in Linux & unix Os please help me out.
if i am trying like this jar -cf xxx.jar .\location of folder ... then i getting error like following -bash: jar: Commond is not found.
I will appresiate you if you reply me as early as possible with answer
Regards,
babuLast edited by babuv27; 02-04-2009 at 08:23 PM. Reason: for add error message


Reply With Quote