Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8353859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:23:11+00:00 2026-06-09T09:23:11+00:00

I have a simple parsing program that takes a few files and combines them.

  • 0

I have a simple parsing program that takes a few files and combines them. It then generates a few output files to the working directory. When I run this program in eclipse it generates all the required output files. However, when I run it using a jar generated in eclipse it only creates two of the three output files. It makes me think something is wrong in how the jar file is generated but can’t seem to find any answers to this.

I’ve tried updating some of the java, it was written using java 5 I believe. I just changed the Vectors to ArrayLists and the FileOutputStream to FileWriter.

I had to download javax.mail to get the required libraries and added those jar files to the java6 library I was using in Eclipse. I’ve tried deleting the classes and generating new classes. I tried to check the permissions on the jar file to make sure that I had access with it. I guess I am just not sure where to start.

I’ve also tried packing this as a jar file and not as a runnable jar file because it gave me more options on what to include. However, I could not run this type of jar file even though it was an executable. I’ve recreated the jar file numerous times without any luck.

There were quite a few problems people had with UTF-8 not displaying properly in a jar file but being fine in eclipse. However their jar files were generating the text files where as mine just does not generate one.

Update: Interestingly if I move the block of code to its own class and run it as a separate jar it will work. So the solution for now is to have two jar files.

This is the code for the ungenerated file:

private static void parseCRNOnly() { 
try { 
    //file to write to 
    File new_file = new File("CRNOnlyClean.txt"); 
    FileWriter out = new FileWriter(new_file); 

    //file to read from 
    File file = new File("CRNOnly.txt"); 
    FileReader reader = new FileReader(file); 
    BufferedReader buf = new BufferedReader(reader); 

    try{ 
        String str; 
        String temp = "\r"; 
        String nl = "\r\n"; 
        String tab = "\t"; 

        str = buf.readLine(); 

        while (str != null && !str.isEmpty()) { 
            StringTokenizer tokenizer = new StringTokenizer(str," \t"); 
            int column = 0; 
            while(tokenizer.hasMoreTokens()) { 
                column++; 
                temp = tokenizer.nextToken(); 
                if(column == 8){ 
                    break; 
                } 
            out.write(temp); 
            out.write(tab); 
         } 
         out.write(nl); 

         str = buf.readLine(); 
         } 

         out.close(); 
      } catch(IOException e0){ 
            System.out.println("Error Reading From CRNOnly.txt"); 
            JOptionPane.showMessageDialog(null, "Error Reading From CRNOnly.txt"); 
        } 
      } catch(FileNotFoundException e1){ 
            System.out.println("File CRNOnly.txt Not Found"); 
            JOptionPane.showMessageDialog(null, "File CRNOnly.txt Not Found"); 
      } catch (IOException e) { 
            System.out.println("Error Reading from FileWriter"); 
            JOptionPane.showMessageDialog(null, "Error Reading from FileWriter"); 
      } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:23:12+00:00Added an answer on June 9, 2026 at 9:23 am

    For some reason the jar file was not including some old libraries that I had to add from javax.mail, so I tried making a jar file using netbeans instead and it worked. Netbeans didn’t pack the javax.mail libraries into the jar file either but included them in a file with the jar file. Therefore to use the jar file this file must be in the directory as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have a simple class that handles the parsing of XML files
I have simple php validation form that is halfway working. If you leave the
I have written a little program that parses log files of anywhere between a
I'm trying to write a C program that grabs command output and then i'll
I have really simple XML (HTML) parsing ANTLR grammar: wiki: ggg+; ggg: tag |
I have a task of parsing a simple XML-formatted string in a MySQL stored
I have simple database - one table with 6 collumns. 3 of them i
I have a program (written in C/C++) that behaves as a socket server. I'd
I have a program that progresses as follows. I call a method called getCharacteristics
I'm writing a (Win32 Console) program that wraps another process; it takes parameters as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.