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.UnsupportedEncodin gException ;
import java.net.HttpURLConnection ;
import java.net.URL;
import java.net.URLEncoder;
import java.security.DigestOutput Stream;
import java.security.MessageDiges t;
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 ';'
()[/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.UnsupportedEncodin
import java.net.HttpURLConnection
import java.net.URL;
import java.net.URLEncoder;
import java.security.DigestOutput
import java.security.MessageDiges
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-
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 ';'
Whats the JDK version on your machine >?
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?
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 }
You mising two semicolon after }
ASKER
How would I use the jikes compiler
Compile on windows. It is not unix error in range -1..-255
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.