Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-04-2007, 11:41 PM   #1
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Rep: Reputation: 30
java - package does not exist error

I'm trying to compile a program I'm writing using a file for one of the classes.

here's my file
public class menu
{ void storage()
  {  System.out.println("storage");
and here's the java file with the main method:

import menu.*;
public class test
{  menu menu1 = new menu();
   public static void main(String[] args)
   { System.out.println("test");
and I'm getting the error

Code: package menu does not exist
I've exported the classpath, "echo $CLASSPATH" shows ":/home/epoo/game/:./"

Any ideas?
Old 06-05-2007, 12:53 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Just comment out the "import menu.*", recompile - and Life should be Good

Here's a very good tutorial that explains the relationship between "package", "import statements" ... and how you need to put your class files in different subdirectories if you decide you need to use packages:

Last edited by paulsm4; 06-05-2007 at 12:55 AM.
Old 06-05-2007, 01:21 AM   #3
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Original Poster
Rep: Reputation: 30
Ahh, I see. That worked, thanks.
I'm having a hard time understanding the difference between static and non-static methods and variables - got any good tutorials for that ?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Yum Error: Transaction Check Error package x(which is newer than package y)... godsk Linux - Newbie 0 06-05-2006 08:13 AM
Tomcat: package javax.servlet does not exist xpucto Linux - Software 0 03-21-2006 07:45 AM
Synaptic Package Manager shows 'java-common' and 'java-gcj-compat' as Installed. swiadek Ubuntu 3 02-12-2006 12:54 PM
How to install MPlayer? Doesn't exist package? Mathsniper Debian 1 06-29-2005 06:19 AM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 10:55 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration