This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

New to packages, works in 1.5 not 1.4  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to using the package keyword. ( I know I shouldn't be. )

The directory structure is
javamail-1.3.3_01/mail.jar
company
company/utils

Inside utils is my Application.class with the statement
package company.utils

as well as the import statement:
import javax.mail.Session;

Calling from root: java company.utils.Application
gives java.lang.NoClassDefFoundError: javax/mail/Session in jvm 1.4

but the same setup on 1.5 works fine.

Anythoughts other than my classpath being incorrect, I can't tell you how many times I have gone over it. All appears well and identical on the 2 platforms.
 
JJ DILLON
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note:

class was found during compile just not at run time.

During compile I got:
loading javamail-1.3.3_01/mail.jar(javax/mail/Service.class)

All of this worked prior to using packages.
 
Java Cowboy
Sheriff
Posts: 16081
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by JJ DILLON:
Anythoughts other than my classpath being incorrect, I can't tell you how many times I have gone over it. All appears well and identical on the 2 platforms.



So what is your classpath set to? It should at least contain mail.jar and your root directory.
 
JJ DILLON
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My classpath shows
'/:./:/QIBM/ProdData/Java400/:/QIBM/ProdData/Java400/javamail-1.3.3_01/mail.jar:/QIBM/ProdData/Java400/company/:/QIBM/ProdData/Java400/company/utils/'

Once again what baffles me is how using the same classpath the compile finds the class but the runtime doesn't.

Both worked prior to using packages.
 
Whatever. Here's a tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!