Question

i try to compile a java program but in the import section of the code fails:

import java.net.*;
import java.io.*;
import java.util.*;
import java.text.*;
import java.awt.*;
//import java.awt.image.*;
import java.awt.event.*;
//import java.awt.image.renderable.*;
import javax.swing.*;
import javax.swing.border.*;
//import javax.swing.border.EtchedBorder;
//import javax.media.jai.*;
//import javax.media.jai.operator.*;
//import com.sun.media.jai.codec.*;
//import java.lang.reflect.*;

how can i fix the problem in a linux debian machine?. Thanks

Java Compiler Compiler Version 4.1d1 (Parser Generator) 
(type "javacc" with no arguments for help) 
Reading from file SAVE.JSigpac.java . . . 
org.javacc.parser.ParseException: Encountered " "import" "import "" at line 443, column 1. Was expecting: "PARSER_BEGIN" ... 
Detected 1 errors and 0 warnings.
Was it helpful?

Solution

javacc is not for compiling java source files, use javac!

OTHER TIPS

JavaCC is a framework if you want to build your own compiler and runtime for a language. Not for your compiling java-files.

Being more specific, you're incorrectly using JavaCC, when what you probably want to use is javac. Give the latter a try and report back? If you don't have javac, you'll need to install an SDK (not just the JRE!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top