LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-19-2004, 11:27 PM   #1
israel
Member
 
Registered: Mar 2003
Location: Canada
Distribution: Slackware 8.1
Posts: 74

Rep: Reputation: 15
javax.swing doesn't work


Im trying to write some code for a school project, but i cannot get my code to compile in my linux box.

I get the following error:

[guest@cs guest]$ javac Combo1.java
Combo1.java:11: Can't find default package `javax.swing'. Check the CLASSPATH environment variable and the access to the archives
Combo1.java:14: Package `javax.swing.event' not found in import.
import javax.swing.event.*;

for some reason the javax.swing class is not recongnized by the compiler
but this code compiles in a windows box.

I also checked the sdk version that im running and it says that i have version 1.3 installed, but the funny thing is that I remember installing version 1.4.2

Does someone know what the problems is?

Im running redhat 9

Thanks
 
Old 02-19-2004, 11:38 PM   #2
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
Did you install the open-source java version which comes with the distribution? Check it out and if installed, removed it.

Last edited by moeminhtun; 02-19-2004 at 11:39 PM.
 
Old 02-19-2004, 11:50 PM   #3
israel
Member
 
Registered: Mar 2003
Location: Canada
Distribution: Slackware 8.1
Posts: 74

Original Poster
Rep: Reputation: 15
mmmm, im not sure.
but how would you remove it in case it is installed?
 
Old 02-19-2004, 11:53 PM   #4
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
I'm not sure what the package name is. Use slackware package manager and look for it.
 
Old 02-19-2004, 11:59 PM   #5
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
And one thing you can make sure what cause your problem.

Go to the installed sun's J2sdk1.4.2/bin directory and run your program from there. It will make sure that you actually using the j2sdk1.4.2.
It should work and if so, it's very sure that you installed the open-source jvm, and you have to remove it. I think open source jvm doesn't have "swing" package.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is import javax.swing.*; Dutchman Programming 4 06-16-2005 10:12 AM
getting javax.swing.* to appear student04 Programming 8 10-05-2004 10:06 AM
Bluez and javax.comm ---> NoSuchPortException philipina Programming 1 06-24-2004 09:16 AM
javax comm for suse linux kingshrimp Linux - Newbie 4 11-26-2003 09:19 AM
Cannot Get Swing to work in a Java Applet? Checkers Linux - Software 0 03-17-2003 03:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration