views:

51

answers:

4

Hello, 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.
A: 

It's not a debian issue ;)

Probably one of those Non-JRE-Classes are missing, but we can't helkp you solve the problem when you don't tell us the error message.

Tobias P.
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.
Stig
+6  A: 

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

Andreas_D
Yes, this is the problem, i installed jdk and i fix it. Thanks
Stig
+1  A: 

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

Tobias P.
A: 

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!)

Dean J
If he has javacc, he'll have javac too ;)
Andreas_D