This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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
Posts: 16084
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.
 
He's giving us the slip! Quick! Grab this tiny ad!
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!