Link to home
Start Free TrialLog in
Avatar of chipw93
chipw93

asked on

Using Java inside of unix environment - trying to resolve a priavte enum character expected error when compiling java file

I got some java code below, and upon trying to compile it in my unix environment, i get the following error
 
()[/home/mgt/gmat]> javac Downloader.java
Downloader.java:37: ';' expected
    private enum ReportFormat {
                              ^
1 error
 
 
This is a portion of the code below
 
   
   
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
 
/**
 * Sample GMAT Score Data File Downloader.
 *
 * @version $Revision: #11 $ submitted $DateTime: 2008/08/18 14:43:29 $ by $Author: chetds $
 * @author Dan Syrstad
 */
public class Downloader {
    private static final String HOSTNAME = "www.domainname.com";
    private static final String RELATIVE_URL = "/entry/gmat/download.jsp";
    private static final DateFormat logDateFmt = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss: ");
       
    private static PrintStream logStream = System.out;
    private enum ReportFormat {
        TXT,
        CSV;
    };
       
    // Discourage instantiation
    private Downloader() { }
               
    private static void emitUsageAndExit() {
        log("Usage: Downloader [-file filename] [-log log-file] [-host hostname] [-format [TXT | CSV]] username password GMAT-progr$
        System.exit(1);
    }
               
Where should i put the expected ';'
Avatar of humanonomics
humanonomics
Flag of India image

Whats the JDK version on your machine >?
Avatar of chipw93
chipw93

ASKER

()[/home/mgt/gmat]> java -showversion
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Isthat the information you were looking for?
can you compile using jikes compiler?
You mising two semicolon after }
Avatar of chipw93

ASKER

How would I use the jikes compiler
Compile on windows. It is not unix error in range -1..-255
ASKER CERTIFIED SOLUTION
Avatar of humanonomics
humanonomics
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial