LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-18-2002, 01:25 PM   #1
Ethan
Member
 
Registered: Mar 2002
Location: California, USA
Posts: 41

Rep: Reputation: 15
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package)


Hi. The Java 2 SDK includes a package java.util.regex. I'm trying to use it like this:

import java.util.regex.*;

Pattern p = Pattern.compile("abc");

But the compiler returns the error "Class not found."

Both my PATH and CLASSPATH include

/usr/local/j2sdk1.4.0/
/usr/local/j2sdk1.4.0/bin
/usr/local/j2sdk1.4.0/lib

I would be grateful for any help with this.

Thanks!

Ethan
 
Old 04-18-2002, 05:02 PM   #2
Ethan
Member
 
Registered: Mar 2002
Location: California, USA
Posts: 41

Original Poster
Rep: Reputation: 15
Problem solved. Turned out the kaffe compiler was installed on the system. Thanks to a suggestion on the Java Developer Connection forums, used find and rpm commands to discover it. Uninstalled it. Now the intended Java compiler is used.

Ethan
 
Old 04-18-2002, 05:03 PM   #3
zmedico
Member
 
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707

Rep: Reputation: 30
You should only need the java "bin" directory in your PATH and thats it. No CLASSPATH or anything else required.

In the future you can check your java version like this:

java -version

This could also help:

which java




Last edited by zmedico; 04-18-2002 at 05:29 PM.
 
Old 04-18-2002, 06:02 PM   #4
Ethan
Member
 
Registered: Mar 2002
Location: California, USA
Posts: 41

Original Poster
Rep: Reputation: 15
Zemedico, thanks!

Ethan
 
Old 02-05-2004, 07:45 PM   #5
jkk21
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
Ethan, can you tell me what you did to resolve your problem? Got any links that spell out the problem and fix? I seem to be having similar/same problem.

My compiler also craps out when using assertions too. Any idea on this one?
 
Old 02-06-2004, 09:55 PM   #6
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
Quote:
Originally posted by jkk21
My compiler also craps out when using assertions too. Any idea on this one?
Sounds like you didn't use the "-source 1.4" option to javac. From the Sun web site:
Quote:
Unless you specifically request source mode 1.4 with the -source 1.4 flag, the compiler operates in source mode 1.3. If you forget to use this this flag, programs that use the new assert statement will not compile. Having the compiler use the old semantics as its default behavior (that is, allowing assert to be used as an identifier) was done for maximal source compatibility. Source mode 1.3 is likely to be phased out over time.
Check it out at http://java.sun.com/j2se/1.4.1/docs/...#compatibility
 
  


Reply



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
Java Package Problems logosys Programming 1 09-27-2005 01:39 PM
Installing java without using the package zwyrbla Slackware 9 01-25-2005 06:40 PM
Where is java 1.4.2_06 package acanton Slackware 2 12-27-2004 08:05 AM
How to find the complete path of an installed package samik Linux - Newbie 1 10-26-2003 02:19 PM
get startet with java (package) j-ray Programming 2 02-01-2002 03:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:29 AM.

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