This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Unable to compile under JDK1.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unable to compile under JDK1.5" Watch "Unable to compile under JDK1.5" New topic
Author

Unable to compile under JDK1.5

jayram joshi
Greenhorn

Joined: Aug 05, 2000
Posts: 23
Hello

I am trying to port a project from JDK1.4 to JDK1.5. During compilation I get following errors

1. package org.apache.xpath.patterns does not exist
2. package org.apache.xml.utils does not exist
3. package com.sun.rsasign does not exist import com.sun.rsasign.c;

I think they were removed from JDK. Can anyone throw some light on where to find respective jars so that the compilation will go through

Thanks
- Jayram
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

All the packages you mention are not part of the JDK, and also not under Java 1.4.

Your application uses some libraries, make sure that you include all the needed libraries in the classpath. It's not different from Java 1.4. Are you now compiling your classes differently than when you were using Java 1.4? Why?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
jayram joshi
Greenhorn

Joined: Aug 05, 2000
Posts: 23
I am certain they are part of JDK1.4. When I look into rt.jar I can see them. But they are missing from JDK1.5's rt.jar.
Patrick van Zandbeek
Ranch Hand

Joined: Aug 17, 2005
Posts: 37
Originally posted by jayramj:
I am certain they are part of JDK1.4. When I look into rt.jar I can see them. But they are missing from JDK1.5's rt.jar.


<YodaVoice> Certain you are? Doubt you do not? hrm? </YodaVoice>

Sun's online java 1.4 api specification
[ August 30, 2005: Message edited by: Patrick van Zandbeek ]

u is a letter, not a word.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Hi, jayramj,

Welcome back to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy that has gone into effect since you were last here.
You can change it here.

Thanks!


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10

1. package org.apache.xpath.patterns does not exist
2. package org.apache.xml.utils does not exist
3. package com.sun.rsasign does not exist import com.sun.rsasign.c;

I think they were removed from JDK. Can anyone throw some light on where to find respective jars?

I am certain they are part of JDK1.4. When I look into rt.jar I can see them. But they are missing from JDK1.5's rt.jar.

I think rt.jar is part of the jre and not the jdk (but I could be wrong about that).

for the first two.

Another option would be to extract the necessary jars from the rt.jar and put them into your project.


Jarhoo is a good resource to know about.
[ August 30, 2005: Message edited by: Marilyn de Queiroz ]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

I am certain they are part of JDK1.4. When I look into rt.jar I can see them. But they are missing from JDK1.5's rt.jar.

I checked; these classes are indeed in rt.jar of Java 1.4.

But since these classes are not mentioned in the API documentation of J2SE 1.4, you should not have used them in your application. They are not part of the official API, so Sun can remove them as they like in a new version.

Read this, it applies not only to com.sun.* packages but to any package that's not part of the official, documented API:
Why Developers Should Not Write Programs That Call 'sun' Packages

You need to re-write your program so that it isn't dependent on undocumented packages.
jayram joshi
Greenhorn

Joined: Aug 05, 2000
Posts: 23
Thanks Guys. I guess I will have add respective jar files to classpath
Yes I agree one shouldnt use undocumented classes. But I am one of those unlucky ones who needs to work on code I didnt write
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to compile under JDK1.5
 
Similar Threads
help me solve 'package javax.servlet does not exist' error
Help me solve 'package javax.servlet does not exist' error
what is the real answer?
Package javax.servlet
"/tags/struts-logic" not found