Home > Default > Java newbie questions...Setting the classpath in Unix

Java newbie questions...Setting the classpath in Unix

October 11Hits:0
Advertisement
When you set the classpath, how do you include anything already in the classpath? For instance, if your profile sets your classpath to
"/home/weblogic/:home/weblogic/weblogic.jar, and you want to add MyJar.jar to it, can you enter:
export classpath=~:MyJar.jar
My question really boils down to how do you prefix the existing CLASSPATH environment variable to any new classes or jars you want to add to it. I think it's the tilde, but I'm not sure.

Answers

In csh, the CLASSPATH environment variable is modified with the setenv command. The format is:
setenv CLASSPATH path1:path2
In sh, the CLASSPATH environment variable can be modified with these commands:
CLASSPATH = path1:path2:...
export CLASSPATH
====
(From the Sun documentation)
or, in sh,
export CLASSPATH=path1:path2
should work

Read other 7 answers

Tags:

Related Articles

  • Java newbie questions...Setting the classpath in UnixOctober 11

    When you set the classpath, how do you include anything already in the classpath? For instance, if your profile sets your classpath to "/home/weblogic/:home/weblogic/weblogic.jar, and you want to add MyJar.jar to it, can you enter: export classpath=~

  • RFCLIB access from Perl / Java  - newbie questionOctober 11

    Hi folks, I am newbie with SAP. I am triying to access the SAP from my web application, wrote in PErl or JAva. I am trying to access the librfc, bit I would like to know: 1) What software I need to install in my client side (the web server that host

  • Java Newbie Question - the import statementOctober 11

    Hi Geeks, I have a problem for importing a java .class in my project. This latter is named "Tedetis_New". Inside it, I created a "src" folder containing all the source code of the application. I import a jar file inside the parent dire

  • Visio like object drawing in Java - newbie questionOctober 11

    Hi all, Although a reasonably experienced java programmer I am new to the world of 2D graphics. I am contemplating writing a tool which includes a diagramming capability for displaying computer systems and interactions between them. I guess this woul

  • Threads in Java: Newbie questionOctober 11

    Hi I had a doubt regarding Threads. I have implemented a Security Manager which does not allow a thread to write into a file. Now, the problem is when the thread tries to write into a file, the Security Manager calls my function in which I want to im

  • Another java newbie question:  "Link errors"October 11

    In the environments I've attempted compiling in, it seems that there is a just-in-time default, which means that any missing classes are not found until run time. Is there any way to to run javac so that what we used to call "link errors" will b

  • Java newbie questionOctober 11

    Hi, I have the following code: public class Dice { public static void main(String []arg){ Scanner scan = new Scanner(System.in); Random ran = new Random(); public void RollDice(){      ran.nextInt(); public int returnDice(){      return ran.nextInt()

  • Unix version of Netweaver Dev Studio, Newbie questionNovember 30

    Hi, I have a very silly newbie question.  Is there a unix version of netweaver developer studio and if so what is the path to the executable? Thanks in advance JohnI don't think so.  NWDS is built on top of Eclipse which is an open source project by

  • Importing Java Class QuestionOctober 11

    Hello, Sorry for such a newbie question and such a long post, I did remember how to do this before but now I can't for the life of me remember. Anyhow, I have a simple question about importing custom-made java classes, from another directory in the w

  • Java newbie help (type casting, 64bit unsigned Long)October 11

    Hi I am java newbie and need help on my project. I have a few questions. Can you put strings in a hashtable and test for their being their with the appropriate hashtable method? I want to test for equal strings, not the same object. Second question c

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.417 s.