• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can't compile a simple class - import error for com.sun.deply.config.Config

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why can't I compile a class that imports com.sun.deploy.config.Config ?

Here's the error:
C:\Users\xxxxx.xxxxx\Desktop\java mixedCode issue>javac SetMixedCode.java
SetMixedCode.java:1: package com.sun.deploy.config does not exist
import com.sun.deploy.config.Config;

Here are my environment variables (windows 7) :

CLASSPATH = c:\Program Files\Java\jre6\lib

JAVA_HOME = C:\Program Files\Java\jdk1.6.0_43

PATH = ...;c:\Program Files\Java\jdk1.6.0_43\bin

Thanks! Hope this is a really easy one. I am a total Java noob....
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Why can't I compile a class that imports com.sun.deploy.config.Config


The class is in deploy.jar so will have to add this jar to your classpath.

BTW You generally shouldn't be trying to import com.sun packages - they are not considered to be part of the public API of the jdk and there's no guarantee they will not change arbitrarily from one version of Java to the next.
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Dave Shupe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tony,
Thanks! I was able to figure out what I was doing wrong from the auto threads that appeared, and from what you wrote. I needed to compile and run the class with an explicit classpath. I was developing a quick little class to patch a little problem at work. Thanks again so much, this was great!
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic