This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!