Find the answer to your Linux question:
Results 1 to 8 of 8
I recently started using RH9 moving toward replacing my win2k pro with linux. It is on a seperate drive of its own. I also have wine installed and am running ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2004
    Location
    Bronx, NY, USA
    Posts
    6

    JAVA on RH9 Linux


    I recently started using RH9 moving toward replacing my win2k pro with linux. It is on a seperate drive of its own. I also have wine installed and am running a few apps - RadioUserland Desktop. Overall I find linux pretty easy to use, I have 15 years experience in MSWin, and have been configuring linux ports and Apache for about a year.

    I've installed a number of apps, both from an RPM and src to compile, with few problems. I installed Sun j2re1.4.2_04 on my linux drive and have installed a few Java apps. But, I can not get any of the Java apps to work. I've located them in the /usr/local forlder, Java is in the same folder. I've located them as a subdirectory of my Java installation. I've written .sh files with JAVA-HOME and classpath pointing to the java installation. I've located them in the /usr/bin folder as this in where the java and jar files are located. I've copied these files into the apps directory.

    All with no sucess ? ! Additionally I keep getting a "-jar not recognized, will ignore: message.

    Can anyone tell me what I am doing wrong, so I can get Java apps to run on my box ?

    Curtis Seyfried
    curtis.seyfried@verizon.net

  2. #2
    Linux Newbie
    Join Date
    May 2004
    Location
    Chennai, India
    Posts
    116
    Ensure Following:

    1. type which java
    expected result: You should get /usr/java/j2sdk1.4.2_02/bin
    if you dont get this,
    a. edit .bash_profile in your home directory and add the below 2 lines.
    Code:
    PATH=$PATH:/usr/java/j2sdk1.4.2_02/bin
    export PATH
    2. Now, try creating a simple java File and Compile it... it should work fine..

    Finally... if NOTHING gets to work, try re installing JVM using --force option.

  3. #3
    Just Joined!
    Join Date
    Jun 2004
    Location
    Bronx, NY, USA
    Posts
    6

    RH9 Java problem

    Thanks very much, that took care of the problem, and now I know where to set user environment paths

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jun 2004
    Location
    Bronx, NY, USA
    Posts
    6

    Still Java on RH9

    Thanks for the help so far I do appreciate it.

    Well, I put the path into .bash_profile
    PATH=$PATH:/usr/java/j2sdk1.4.2_02/bin
    export PATH

    I then ran a .bin installer for a Java app I had been trying to install. Now the installer DID find an installed Java VM, and it installed the application.

    When I went to Run the application I get the following error message :

    Exception in thread "main" java.lang.NoClassDefFoundError: com/clevercactus/spaces/Spaces

    I tried running a few other Java Apps I had been wanting to use with the same results all of them return

    Exception in thread "main" java.lang.NoClassDefFoundError:

    I remember having this problem in Windows when I 1st started using Java apps, and it was a path problem, but I had thought that was solved with the PATH being put into the appropriate config files.

    I even tried
    /usr/java/j2sdk1.4.2_04/bin/java clevercactus.jar

    Also if I put -jar in the command it retuns -jar not recognized, ignoring.

  6. #5
    Linux Newbie
    Join Date
    May 2004
    Location
    Chennai, India
    Posts
    116

    Re: Still Java on RH9

    the changes will you made to .bash_profile will *ONLY* take effect in NEXT login. or you need to
    Code:
    $ source .bash_profile
    to have an immediate effect in the CURRENT shell.

    It seems you are having problem with your classpath. Try adding this in your .bash_profile
    Code:
    CLASSPATH=$CLASSPATH:.
    export CLASSPATH
    this *FORCES* the JVM to look for classes from current directory also...

    and if you want to use any classes that comes in JAR file. you need to specify the jar file in classpath.

    Code:
    CLASSPATH=$CLASSPATH:myjar1.jar:myjar2.jar:myjar3.jar
    hope this helps.

    regards,
    Sunny.
    NEVER stop/pause Journey of Learning -Travelling Soldier ( Me )

  7. #6
    Just Joined!
    Join Date
    Jun 2004
    Location
    Bronx, NY, USA
    Posts
    6

    Java on RH9

    Thank you very much.

    I'll try this and see. I just expect that when an app installs it will do all of the config writing itself, especially when it is a runtime or development version of a programming language.

    I'm not a programmer. Years ago I took a number of programming courses, Xbase, Clipper, C, C++. I learned that I can learn the theory very well, but that I do not have the mindset to actually write programs. But, it did give me a better understanding of dcomputers, O/S's and apps, so it was still worth doing.

    :P

  8. #7
    Just Joined!
    Join Date
    Jun 2004
    Posts
    1

    Blackdown Java

    Download Blackdown.

    This is taken from the "INSTALL" file:

    The Blackdown Java(TM) 2 SDK, Standard Edition, v1.4.2-rc1 is
    available as a shell script with an embedded bzipped tarball which can
    be used to install the Java2 SDK in a location chosen by the user:

    - Make the shell script executable
    % chmod +x j2sdk-1.4.2-rc1-linux-<ARCH>.bin
    (Replace <ARCH> with the architecture of your system, e.g.
    replace <ARCH> with i586 if your on an Intel system.)
    - Change to the directory you want to install into, e.g /usr/local
    % cd /usr/local
    - Extract the contents of the Java 2 SDK by running the shell script
    % ./j2sdk-1.4.2-rc1-linux-<ARCH>.bin
    (Replace <ARCH> with the architecture of your system, e.g.
    replace <ARCH> with i586 if your on an Intel system.)
    - Add j2sdk1.4.2/bin to PATH, e.g. if you installed into /usr/local
    % export PATH=/usr/local/j2sdk1.4.2/bin:$PATH

    ... and then it continues with the rest of the instructions. I am new too RH9 Linux also and I spent close to 3 weeks messing with SUNJava and... GRRR! I think its just broken for RedHat9 or something. There doesn't seem to be an overwhelming amount of insterest or support in the Java area when it comes to RH9 either.

    Anyway, I feel your pain. Download Blackdown and follow the instructions. It worked on first try for me.

    http://www.blackdown.org/java-linux/java-linux-d2.html

    Hope this helps.

  9. #8
    Just Joined!
    Join Date
    Jun 2004
    Location
    Bronx, NY, USA
    Posts
    6

    JAVA on RH9

    Thanks,

    It's good to at least know there are others having a problem. I'll try the Blackdown installation and see if it works any better.

    Something wierd also. After some advice to manually place the java path in the .bcprofile of each users, 2 java apps I tried to install found the j2sdk installation and installed themselves OK, but when I try to use them, they can't find java. Also, the -jar command has never been recognized.

    Curtis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •