Results 1 to 2 of 2

Thread: Newbie classpath question

Hybrid View

  1. #1

    Newbie classpath question

    Hey guys. Sorry for the stupid question, but I can't seem to find the answer anywhere.

    Every time I try to run a java program, I get the following error:

    Error occurred during initialization of VM
    java/lang/NoClassDefFoundError: java/lang/Object

    Looks like java can't find the built in libraries. I know I have to point the $CLASSPATH variable to something, I just don't know what. I've tried "." (current directory) and a few I thought might work in my jre directory, but nada.

    Java Home (this is correct) :

    Code:
    conor@conor-lt:~/Desktop$ echo $JAVA_HOME
    /usr/java/jre1.5.0_02
    Can anyone tell me where I should point $CLASSPATH to make java run?

    Thanks.

  2. #2

    Re:Newbie classpath question

    If you're using *nothing* but built-in stuff, then your classpath should be figured out based on your java_home variable, iinm.

    The trouble usually arises when you try to run a program that needs stuff that isn't built in. Usually, well-behaved java developers will write a wrapper script that sets the appropriate classpath variable and then does the requisite incantations to get things launched. Occasionally, though, they don't, and you're left to figure it out for yourself.

    If the app comes with a bunch of jar files, you might have to use an absolute path either to the directory containing those files, or, if it comes with just a few jar files, you can actually use absolute paths to each individual jar file as the classpath (see the -classpath line in the java help output).

    If the executable *itself* IS a jar file, run it like "java -jar app.jar"


Similar Threads

  1. newbie CVS question
    By countach44 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 06-27-2004, 05:51 AM
  2. Newbie....First Question.
    By Brandonium in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 09-21-2003, 06:52 PM
  3. QT Newbie Question
    By Tyr_7BE in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 11-29-2002, 02:32 AM
  4. Newbie Question
    By exidous in forum Redhat / Fedora
    Replies: 1
    Last Post: 07-12-2002, 04:31 PM
  5. Newbie Question
    By hyxodus in forum Linux - General Topics
    Replies: 4
    Last Post: 03-07-2002, 01:38 PM

Bookmarks

Posting Permissions

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