problems importing my class

Hello

I'm writting just a simple game to get me back into java using Linux 7.0

When using windows a while back it compile ok buy wont on my Linux

I have provided just the import statements because i know the rest of the code is fine.

import java.awt.*;

import java.awt.event.*;

import java.io.*;

import java.swing.*;

import java.TicTacDlg;

Error i get is:

TTacToe.java:12: '.' expected

import TicTacDlg;

^

1 error

TicTacDlg.java is in DIR is in '/root/java' along with the rest of the classes.

I have tried setting CLASSPATH to above path and '/usr/java/j2sdk1.4.0/lib/tlib/tools.jar'

Is it correct to set CLASSPATH to tools.jar, as u do in windows?

I'm using the beta version of java 2 SDK 1.4 standard addition

I'm

[868 byte] By [geministar] at [2007-9-26 4:21:04]
«« Need help
»» email
# 1

I am confused. The code says import java.TicTacDlg;

and the compiler error you pasted says import TicTacDlg;

Anyway, I am sure about one thing. You cannot have your own package named java....

So, If you are saying that your TicTacDlg.java started with package java;

that is not allowed.

You may want to rename your package.

vijayreddy at 2007-6-29 17:24:56 > top of Java-index,Archived Forums,Java Programming...
# 2

Sorry, the statement:

import .java.TicTacDlg was actually a typo made when typing this message and is actually:

import java.awt.*;

import java.awt.event.*;

import java.io.*;

import java.swing.*;

import TicTacDlg;

Also as i'm have not done any java since early 1999 in UNI. I have noticed newly introduced words i.e "package" please explain.

Is a package just another word for classes, such as TicTacDlg.java as i have defined.

In those days we were using JSDK 1.2 and did not use the word package. Please give example if can.

Thanks

geministar at 2007-6-29 17:24:56 > top of Java-index,Archived Forums,Java Programming...
# 3
I remember now.packages are just a way of grouping related classes and interfaces.: )
geministar at 2007-6-29 17:24:56 > top of Java-index,Archived Forums,Java Programming...