• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to compile under JDK1.5

 
jayram joshi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
jayram joshi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic