Jump to content
  • Advertisement
Sign in to follow this  
andyb716

[java] Java 1.5 for linux

This topic is 4954 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I recently bought a java book from deitel and deitel. And I can't compile the program that uses System.out.printf(), I got it to work on my windows XP machine but I can't for my red hat 9 machine. I downloaded the 1.5 JDK from sun and tried to install it and it said It was already installed. I also looked at the java console thing and it said I do have 1.5 installed, I also tried to import javax.swing.JOptionPane just to see if I could get a message box to pop up and it gave me a compliling error saying it can't import that package. It all works fine with windows, maybe I should just program on there. I don't know I just want to see if I can get stuff to work on both. Thanks for any ideas.

Share this post


Link to post
Share on other sites
Advertisement
Did you make sure your path environment variable is pointing to the new installations bin directory?

Does the classpath have to be explicitly set in Linux? I know on Windows it does not anymore, but I have no experience with Linux.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
No, everything is automatic with linux too - no classpath should ever be set.

My guess is taht yuo didn't uninstall a previous version of linux, or that your RPM database is screwed, or that you didn't use the RPM and did something weird, or that you have a crappy piece of **** distro called redhat which often breaks fundamental features.

I'm going for the latter as second most likely, only beaten by the "didn't uninstall older version" option.

Redhat + Gnome are screwed up badly in many very small but significant ways (I've been building and admin'ing RH systems since RH 5.1), and you just have to learn and memorize all the workarounds to all the bugs. I now run Debian for all new machines (desktop and server) because it's so much harder to break your system, and your system has many times fewer bugs (although they are often debian-exclusive and not documented, because an idiot debian maintainer decided to make a change to a standard package like MySQL, not tell anyone, and break the docs *grumble grumble*).

This isn't just a rant -it's friendly advice: RH is hard to keep working 100%. It's very easy to keep working 90%. If the basic things like unintstall / reinstall java don't work, you probably have some nasty problem RH-specific.

Share this post


Link to post
Share on other sites
Sorry i don't know too much of linux. I have a book to look through and the internet so I can look up stuff. My question is that I used the rpm -e jdk1.5.0 to remove the package and then the rpm -iv jdk1.5.0 to put the new package on. But it still seems to give that error. Am I doing this right? It says it comes with jdk1.5 anyway to I can't understand why it doesn't work.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You say you have problems compiling. How are you compiling?

Share this post


Link to post
Share on other sites
Quote:
No, everything is automatic with linux too - no classpath should ever be set.


Rot in Hell, you evil Spawn of Default the Defiler! (figuratively speaking, nothing personal - excuse my vivid language! ;)

I can imagine a lot of situations where you WILL want to change the CLASSPATH or even the BOOTCLASSPATH. Developing for the Connected Limited Device Configuration, for example.

But yes, usually, on most linux distros, Java should at least work 'out of the box' in a fashion that you can compile your "Hello World" with it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Thygrrr
Quote:
No, everything is automatic with linux too - no classpath should ever be set.


Rot in Hell, you evil Spawn of Default the Defiler! (figuratively speaking, nothing personal - excuse my vivid language! ;)


Ditto to you, freaky weirdy-beardy J2ME developer :P

IIRC it is actually officially advised by Sun not to set classpaths for J2SE, because in 99.99% of cases it has been replaced by other mechanisms that achieve the same functionality better (e.g. SPI, EXTs, etc)

redmilamber

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!