473,420 Members | 3,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

the import java.util.regex cannot be resolved... what am I missing?

jhardman
3,406 Expert 2GB
So I'm trying to use regular expressions, but my compiler keeps failing at
Expand|Select|Wrap|Line Numbers
  1. import java.util.regex.*;
I know that the regex package is supposed to be there, every reference I have found put it right there. Intellisense recognizes java.util and suggests several classes within it (timer, random, etc), but nothing after that.

The truth is, I have more experience with visual studio, in which I know at this point I would be missing a reference. Is that the case here? If so, how would I add it?

I'm actually using eclipse as my IDE - required to make blackberry apps. Anyone know of a way to do this in Eclipse? Or if not, is there an easier way to get to regular expressions?

Jared
Sep 27 '10 #1
7 12267
Oralloy
988 Expert 512MB
Jared,

I'm shooting in the dark here.

Are you certain that java.util.regex is in JavaME?

If not, you'll have to provide a copy. You get the source as part of the Java/EE package.

Luck!
Oralloy
Sep 27 '10 #2
Dheeraj Joshi
1,123 Expert 1GB
Well, what Are the compiler errors?

Regards
Dheeraj Joshi
Sep 28 '10 #3
jhardman
3,406 Expert 2GB
OK, I know a bit more now. In order to run my app on a blackberry, I had to use a custom java library. It doesn't implement all of the standards. If I add the standard JRE6 to the build path then I get a whole bunch of duplicate definition errors, so they have a lot of overlaps, but there are several key classes I'm missing.

I'm still stuck, but I think I at least know why I'm stuck.

Unfortunately, I don't know enough about the environment (eclipse) to know how to add a single library reference (just java.util.regex.*) without getting the duplicate definitions. anybody know how to do that?

Jared
Sep 28 '10 #4
Oralloy
988 Expert 512MB
@Jared,

I'd say just copy the source for the java.util.regex classes and have done with. There are only five files that you have to worry about.

How to do it "right", though, is another issue. You'll have to modify your jar packaging instructions.

Luck.
Sep 28 '10 #5
jhardman
3,406 Expert 2GB
Wish I knew how to add the .jar to my package. That might solve my issue.

Jared
Sep 29 '10 #6
Dheeraj Joshi
1,123 Expert 1GB
You meant to say adding a jar file to project set up(workspace)?

Regards
Dheeraj Joshi
Sep 29 '10 #7
jhardman
3,406 Expert 2GB
right... I wish I knew what I was talking about, but I'm really in a bit too deep.

Jared
Oct 1 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David | last post by:
I need to write a regular expression to group lines of text separated by a blank line. Ex. Input: line1 line2 line3
4
by: 3rdshiftcoder | last post by:
Hi- I'd like to use this class from a book but am getting a compiler error. On the line private List < String > list; p.932 Chapter 19 found in the code below in the eclipse editor it is...
4
by: puntino | last post by:
Hi I have created my Alarm, at compile time I don't have any problem, but at run time I receive the follo wing messages: Exception in thread "main" java.lang.NullPointerException at...
5
by: ramadeviirrigireddy | last post by:
Hi All, I'm have a program which will import java.util.Queue class. But i'm getting error here saying that "The import java.util.Queue cannot be resolved". can anyone tell me why is this...
3
by: Dameon99 | last post by:
Hi.. Im experiencing a weird error I dont know how to fix. I have a scanner object and whenever I use nextInt, anything above 3 causes the program to crash saying and links me to this line of the...
6
by: jri | last post by:
Hello, I got an assignement for school where I have to make a game with matches. This is what I got: import javax.swing.JOptionPane; import java.util.Scanner; public class Lucifer
4
by: HaifaCarina | last post by:
here's the complete lines of errors.. Exception in thread "main" java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:332) at...
4
by: sukatoa | last post by:
This was my first time to encouter this kind of exception.... that exception appears when i invoked the the method below. private final String encrypting(String enc){ int...
1
by: jimgym1989 | last post by:
I dont get it..why is the error: Exception in thread "main" java.util.InputMismatchException this is my code /** * @(#)textFileRead.java * * * @author * @version 1.00 2008/10/17 */
6
by: monkey0525 | last post by:
Each time I run the ProgTwo program, it displays: 1. Display one product 2. Display all products 3. Add a new CD 6. Exit Enter your choice: Exception in thread "main"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.