Linux - j2sdk1.4.2_06 can't set path/classpath

I am struggling to get my java set up to write, compile and run some java programs, and honestly being a linux newbie the docs for such are somewhat confusing..
I am trying to break this down as simple as possible.
-I am logged into Linux as root.
-then download the j2sdk1.4.2_06 in the /USR/ dir
-I did chmod +x j2sdk1.4.2_06...
-then./j2sdk1.4.2_06...
it installed successfully.
but setting up the path classpath is different.
I would like two things:
for my mozilla browser to now be java enabled, AND
I would like to create a directory called javasrc to hold all my java source code
but I do not want to develop in root, I want any user to be able to use the javasrc directory and be able to compile and run the programs..
what exactly do I edit. someone said I need to edit a file in /ETC/PROFILE
I want to try this..but I dont think it is correct
export JAVA_HOME=/usr/j2sdk1.4.2_06
PATH=$HOME:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/X11:/sbin:/home/mqm/bin:$JAVA_HOME/bin
export PATHthanks

I'd advice you to not touch CLASSPATH until you've studied how packages and classloading work. Until then it will just get on your way.
What comes to setting PATH, the file to modify in /etc depends on your distribution -- a least in some versions of SuSE /etc/profile is generated by a script and you are supposed to modify /etc/profile.local instead. You could also edit a file called ".bashrc" in your home directory. The manual page of bash explains the differences between using these files. If you modify /etc/profile you need to either start a new login shell or source the file for the change to have effect. The lines to write are:export JAVA_HOME=/usr/j2sdk1.4.2_06
export PATH=$PATH:$JAVA_HOME/bin

Similar Messages

  • How can i set the classpath??

    CAN ANYONE PLEASE HELP ME HOW TO SET THE CLASSPATH IN WINDOWS ME ,WHAT IS THE RIGHT CODE TO SET THE CLASSPATH I AM USING JDK1.3 VERSION.
    THANK YOU VERY MUCH
    ERICK LUCCIO

    Try this way Start->Program->System tools-> System Summary>startup .Try to find the variable classpath,make sure the path is correct.The classpath contain the the *.java & *.class you save. I'm also new in java .This path & classpath question is so trouble to me .Now i'm running jdk1.3.1_2 in WINME ,WINNT AND WIN2000 IN no problem.........

  • I can't set my classpath to compile serlets any help?

    I don't understand I'm doing it the way my book says to do it but I can't for the life of me set a freaking class path for my tomcat server so I can compile my serlets here's how it says to do it
    C:\Documents and Settings\Compaq_Owner\Desktop>javac -classpath C:\Program Files\Apache Software Foundation\Tomca
    t 5.0\common\lib\servlet-api.jar
    Can anyone tell me what the hell I'm doing wrong any help is greatly appreciated thanks

    Ok I think I get what your saying but couls someone show me the syntax where to include the source files at and how here's what I did but it couldn't read the file so I'm guessing I'm not putting it in right and also is there a way to permanently set the classpath so I won't have to go through this everytime I want to compile java servlet files?
    C:\Documents and Settings\Compaq_Owner\Desktop>javac -classpath "C:\Program Files\Apache Software Foundation\Tomc
    at 5.0\common\lib\servlet-api.jar" "C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jhtp6\WEB-INF\
    classes\WlcomeServlet.java"
    error: cannot read: C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jhtp6\WEB-INF\classes\WlcomeSe
    rvlet.java
    1 error

  • How can I set PATH environment variables when there is no ~/.profile?

    Hi,
    I have a MacBook Air and just installed MySQL.
    I read the doc which I downloaded and should be able to run "mysql" from terminal as descibed below:
    Suppose that your MySQL programs are installed in /usr/local/mysql/bin and that you want to make it easy to invoke these programs. To do this, set the value of the PATH environment variable to include that directory. For example, if your shell is bash, add the following line to your .bashrc file:
               PATH=${PATH}:/usr/local/mysql/bin
    I checked on my terminal with ls -al, but no ~/.bashrc also no ~/.profile files.  Echo $SHELL shows me that I am using /bin/bash as shell.
    When I run export PATH=$PATH:/usr/local/mysql/bin  then it works and I just have to type "mysql" to get the mysql command line but as soon as I kill my terminal and open a new terminal this setting is lost.
    Any idea how I can accomplish this?
    Thanks,
    MacNewby

    Hi,
    Never mind, I found it :-)
    I just created a file  .bash_profile in my home folder and added "export PATH=$PATH:/usr/local/mysql/bin" and restarted my terninal. Now it works.
    MacNewby

  • How can I set path to icon

    I am using NetBeans 5.5.
    Some part of my JavaSE application I made with help of GUIBuilder + I've worte my own code for GUI.
    The problem is:
    My buttons use icons.
    When I launch my app in NetBeans - everything is O.K.
    But
    When I try to lauch my jar file "myproject/dist/myproject.jar"
    I get an error
    "myButtonIcon.jpg is not found"
    Through GUIBuilder I have several ways to set icon to button:
    1.File. It makes HARD link to file, like:
    jButton3report.setIcon(new javax.swing.ImageIcon("D:\\source\\Dfree\\resource\\menuoldico\\report.jpg"));That is awful variant! But jar file launches - no errors
    2.Classpath. It lokks like this way:
    jButton1workdoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menuoldico_/adddocument.jpg")));Seems that's ok.
    I've added folder resourse as[b] library to project.
    folder menuoldico lies there.
    I put my lib with icon folder near jar file.
    Ni result!
    It doesnt' work
    Where is mistake?
    P.S.
    JDBC connector lies in the same forlder, and jar file can find it and use
    but jar file doesn't see folder with icons
    Help me please.

    Hm...seems like this is another good variant.
    But there is a way to put icons into jar!
    1. Just create folder (for example "MyIconsSet") in folder "MyProject/src"
    2. Put there all icons or images you want to use.
    3. NetBeans recognizes created folder "MyIconSet" as package
    4. Just write path to icon as:
    jButton1workdoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/adddocument.jpg")));NetBeans will include this "package" into jar. The easiest and convinient way
    And you will not have any problems!!!
    I didn't read manual properly.
    It's written there!
    Problem is solved.
    kynamar, thanks for your code.
    Message was edited by:
    Holod

  • Can't set PATH to my 1.4.2_07, why?

    I have 1.5.0 JRE installed (since my browser complained, need to install before I can access some site).
    Next I install 1.4.2_07 (J2SDK) , installation is smooth.
    But when I open a new command window and type "java -version", the 1.5.0 responded.
    I tried to set the environment PATH (both user and systems, tried) to point to my 1.4.2_07 directory and then run "java -version". Again the 1.5.0 responded.
    I tried to search for PATH info of 1.5.0 in the environment variable but found none.
    Can any one kindly advise me where is the 1.5.0 path being set? How can I select a JRE to use (both at DOS prompt and IE)?
    Also, my control panel only have 1 Java applet for configuration.
    I am using Windows 2000 Pro, SP3.
    Thanks in advance and looking forward to your reply.
    I am intending to uninstall both 1.4.2_07 and 1.5.0, followed by installing J2SDK for both, 1.4.2_07 followed by 1.5.0, is it advisable?
    Regards,
    Jacky

    We need to split the question into 2 parts, 1) the browser, and 2) the default from the commandline.
    For IE, the JRE/Plug-in is selectable from Window Control Panel | Java Control Panel. The exact details are different between 1.4 and 1.5 versions. In 1.4, iirc, the Java tab has a dropdown box to select what Java version IE will use. With 1.5's Java Control Panel, you'll need to read this document, which explains how to change the setting - scroll down to where it discusses the Java Applet Runtime Settings:
    http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/jcp.html
    There can only be one Java version installed in IE. Use the above information to change to a different version.
    Now, about the commandline.
    Typically the last Java version installed becomes the default (the one that responds when just "java ..." is typed without a path.) If 1.5 is the last installed, then just typing java -version will execute the 1.5 version of java.exe
    Other versions are able to be accessed by using a full path to the java.exe, javac.exe, and other tools for that version. For instance, if you have 1.4 installed in C:\Program Files\Java\jdk1.4.2_07, then that version's java can executed by typing "C:\Program Files\Java\jdk1.4.2_07\bin\java ..."
    Only one version of java.exe can be the default, all others can be executed by using the full path, as above. One approach is to create small batch files to set the environment (PATH, and CLASSPATH if desired), which can temporarily override the default version by reconfiguring the PATH variable to point to the different version.
    To set the PATH in 2000, go to #5 of any of the SDK/JDK Installation Instructions; there are detailed instructions there. Links to the instructions can be found where you do the downloads.
    The current versions are 1.4.2_07 and 1.5.0_01. The last one you install will become the default, as discussed above. Your choice.

  • Setting Path,Classpath in Mandrake 8.2

    I have added the following lines to the .bashrc .bash_profile for my regular user
    and /etc/profile and i still cannot find the java path with a regular user but using root i can
    Shouldn't the /etc/profile allow all users to access the java directory?
    export JAVA_HOME=/usr/local/j2sdk1.4.0/
    export PATH=$PATH:$JAVA_HOME/bin/
    export CLASSPATH=$JAVA_HOME/lib/
    Thanks

    I'm in the same boat as you are. Did you ever get the java working??

  • How I can set up CLASSPATH and JAVA_HOME and change default JAVA_HOME

    Hi all!
    I am new in Solaris world.
    I have installed jdk1.3.1 for Solaris.
    But default java version is 1.2.1.
    How can I set up CLASSPATH and JAVA_HOME.
    How I can change default setting.
    I need to know a name of configuration file and where can I find it?
    default java

    See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    It says
    One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back.

  • How to set the classpath in CVM?

    Hi everybody,
    experimenting with the J2ME Personal Profile Runtime Environment on a Linux PC I wonder how to set the classpath. The command line options only allow me to set the bootclasspath.
    My original problems deals with determining the codebase for a class that is contained in a jar.
    1) If I put this jar into the bootclasspath, that class is found and can be loaded, but the codebase (retrieved using class.getProtectionDomain().getCodeSource) is NULL.
    2) If I put it into the classpath by using the command line option -Djava.class.path=... the class cannot be found by the ClassLoader.
    3) If I put the jar into both, the classpath and the bootclasspath, the latter one is applied and result 1) shows up.
    Any idea how to work around this?

    @see http://forum.java.sun.com/thread.jsp?forum=8&thread=410868

  • How do I set the classpath in runtime?

    How can i set the classpath in runtime?
    Im downloading my image files in the folder C:/Downloads
    I want to set this C:/Downloads as my classpath.
    I don want to set it at the initial stage, bcoz I may have to change the downloading directory D:/Selva.
    I want to access my */utils/New.gif* image available in the downloading directory by using getResource() method.

    java.net.URL urldir= new java.net.URL("file://C:/Downloads/");
    java.net.URL[] urlarr= new java.net.URL[1];
    urlarr[0]=urldir;
    java.net.URLClassLoader urlcl= new java.net.URLClassLoader(urlarr); +// Here I get the Error+
    url=urlcl.getResource("/lrp/utils/New.gif");
    *Error: java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Set path on mandrake linux

    i have aproblem
    i can't find the file where i should set the java command path
    i only could do this on the command line
    please help

    Are you familiar with any Linux or Unix system at all?
    First read up on how to set your path and environment variables. The answer will depend on what shell you use (bash, csh, ..). Typically, all these shells source certain "rc" (e.g. $HOME/.bashrc) files on startup. You set the PATH and JAVA_HOME environment variables there.
    On RedHat (and Mandrake), you can set a system-wide PATH with java in it, using the following trick. Put these files in the /etc/profile.d directory (the files will be called "java.sh" and "java.csh"). Adjust the path (/usr/java/j2sdk1.4.2_02) to match your installation directory.
    ==== cut here - start of java.sh ====
    JAVA_HOME=/usr/java/j2sdk1.4.2_02
    if ! echo "$PATH" | grep -q "$JAVA_HOME/bin"; then
            PATH="$PATH:$JAVA_HOME/bin"
    fi
    export JAVA_HOME PATH==== end here - end of java.sh ====
    ==== cut here - start of java.csh ====
    setenv JAVA_HOME /usr/java/j2sdk1.4.2_02
    echo "$PATH" | grep -q "$JAVA_HOME/bin"
    if ( $? != 0 ) then
            setenv PATH "$PATH":"$JAVA_HOME/bin"
    endif==== end here - end of java.csh ====
    With these files in place, everyone who logs in to the system will see JAVA_HOME in their environment, and see PATH set up with the JDK bin directory in it.

  • How to set path in linux?

    Hi,
    I tried to compile a form in linux.
    I use the following command:
    export LD_LIBRARY_PATH=/u0/oracle/prodora/8.0.6/lib
    f60gen module=/u0/oracle/prodappl/ar/11.5.0/forms/US/TESTFORM.fmb USERID=apps/****
    An fmx is generated. But during compile it also give the following message:
    FRM-18108: Failed to load the following objects.
    Source Module:TEMPLATE.fmb
    Source Object: FRAME_HORZ_LINE
    Source Module:TEMPLATE.fmb
    Source Object: FRAME_RECT
    Source Module:APPSTAND
    Source Object: STANDARD_PC_AND_VA
    Source Module:APPSTAND
    Source Object: STANDARD_TOOLBAR
    Source Module:APPSTAND
    Source Object: STANDARD_CALENDAR
    I suppose it because it cannot found template.fmb and appstand.fmb.
    How do I include the path to this files? For example the path is this: /u0/oracle/prodappl/ar/11.5.0/forms/US
    Can I add it using the "export LD_LIBRARY_PATH" command?
    What is the syntax for multiple path for the "export LD_LIBRARY_PATH"?
    I cannot execute it one after the other as it seems the later overwrite the former.
    Thank you
    Jim

    I do:
    export FORMS_PATH=/u01/app/oracle/product/apps/your_source Will it overwrite any path in the FORMS_PATH, or will it add into it? Or is it not permanent?
    this is not permanent solution,your just setting path.
    Refer metalink note
    What is Difference between the Forms_path and the working directory? [ID 551511.1
    Edited by: Amigo on Dec 22, 2010 1:20 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem in setting path and classpath for java in RedHat linux 9

    Hi ,
    i am not able to set the PATH and CLASSPATH for j2sdk1.4.2_06
    I have tried with export PATH=$PATH:/usr/j2sdk1.4.2_06/bin
    and export CLASSPATH=$CLASSPATH:/usr/j2sdk1.4.2_06/lib
    in terminal
    but i want to configure it as permenant way for the jre and jdk
    and we should only type java or javac according to the requirement
    regards mihir...

    type those in .bashrc ... save and exit
    then at prompt, type 'source .bashrc'
    this is the permanent solution ...
    bhalo thakun

  • How can i set a path for my deployment files in weblogic server 10.3

    Hi
    How can i set the path for my WAR ,JAR files while deploying.i am using the wls10.3 version.
    is there any scripts for this ,please provide me.
    my Application is ADF 11g application.

    By "path", I assume you mean "classpath".
    The simplest way is simply to include the jars you need inside the web application or web module's WEB-INF/lib directory, EJB module's META-INF/lib directory, or EAR lib directory.
    If that's not practical, if you use NodeManager to start your servers, you can go to the "Server Start" tab in the server definition in the WebLogic console and edit the "Classpath" field, which defaults to no value. You can specify a classpath value there. Note that if you specify a value there, it REPLACES the default classpath for the server, it doesn't add to it. If you need to just add to it (a much more likely scenario), if the value references the value "$CLASSPATH" in it, that will reference the original classpath value that the server would have had.
    So, for instance, if you wanted to include the MQ jars in the server classpath, you could set a value like this:
    /usr/java/mq/lib/mq.jar:/usr/java/mq/lib/mqstuff.jar:$CLASSPATH

  • How can I set the PATH properly in XP?

    Ive stuffed around for hours trying to do this. Ive installed j2eesdk-1_4_2004Q4-beta-windows.
    I wrote a simple app in jGrasp, then hit compile and it comes up with
    "package javax.ejb does not exist
    import javax.ejb.*;"
    Now my PATH looks something like this
    C:\Sun\AppServer\bin;C:\Sun\AppServer\jdk\bin;C:\Sun\AppServer\lib\j2ee.jar;
    this just doesnt work....
    Can someone who writes j2ee apps in XP plz let me know how to set up the class path so i dont get these package not found errors.
    It would be a great favour, thank you.
    PS when i move the j2ee.jar file into the jre\lib\ext folder it compiles, but this seems dodgy to me. Plz help me.

    Either set the classpath pointing to j2ee.jar when building your app (javac -classpath ...\j2ee.jar) - if you are using ant scripts to build, checkout the samples or blueprints applications for examples of how to set the classpath within ant scripts
    Or set your CLASSPATH environment to ...\j2ee.jar (My Computer->Control Panel->System->Advanced->Environment Variables
    Hope this helps

Maybe you are looking for

  • MRP run without one storage location

    Dear All, My client's requirement is they need to run MRP on plant level without considering one storage location stock e.g if a material is having stock of 10 in unrestricted with storage location 1104. Now when mrp is run for 100 quantity planned o

  • IPad not recognized by itunes or my PC...stuck in recovery mode

    Wow... what a mess. I inherited a first gen iPad last week... wanted to wipe it clean and start fresh.  Restored and erased all content... and now it's stuck in recovery mode.   It's not recognized in iTunes or at all by my PC.   When I plug it in...

  • White Lines on Live Traced Artwork in PDF from Illustrator CS3

    Hi,<br /><br />I've recently been using the Live Trace feature in Adobe Illustrator CS3 on my artwork so that my artwork becomes a vector image instead of a raster (I'm told it's better for Web because it works better with varying resolutions - doesn

  • Error on the cosole of WebLogic6.0.

    guys,           i am getting the following error on the cosole of WebLogic6.0.           Error WAE-020: ERROR: No option set for where to go next.           <Jun 18, 2001 12:28:47 PM CDT> <Error> <HTTP>           <WebAppServletContext(5175025,Defa   

  • How to install Oracle Text?

    How to install Oracle Text?