Java command not working - path problem ?

Im not really new to Java, but rather new to Linux :=)
Ive got NetBeans setup and working great on Redhat 7.2 and I can run Java apps from within the IDE...but not from a command line. I get "bash: java: command not found"
This tells me something is amuk with my path, because obviously the bin folder is not on the path ???
Help :=)

also, ive got this in my .bashrc file
#JDK Home varible
JDK_HOME=/usr/java/j2sdk1.4.0_01

Similar Messages

  • Java command not working

    Hi
    I m learning java since few weeks.... I am facing problem in running java class using java command.I have a folder as
    D:\deepali\Bday\Birth\web-inf\classes\BI
    in this folder i have TryAPI.java file. Its getting compiled properly. but whenever i give command as
    java TryAPI
    it gives me the following error
    D:\deepali\Bday\Birth\web-inf\classes\BI>java TryAPI
    Exception in thread "main" java.lang.NoClassDefFoundError: TryAPI (wrong name: BI/TryAPI)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    My path is
    D:\Oracle\Ora81\bin;C:\Program Files\Oracle\jre\1.1.7bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;;D:\tibco\tibrv\BIN;C:\j2sdk1.4.2_05\lib;C:\j2sdk1.4.2_05\bin;;D:\tibco\BIN;C:\TIBCO\TIBRV\BIN;
    Can anyone explain me why this is happening?
    Thanks and Regards
    Deepali

    You see the error message that says "wrong name. . ."?
    That means you used the wrong name for the class. You have it in a package, but you didn't use the package name. (You have to)
    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    And a statement to run the program is:
    java myapp.aProgram
    (This can be issued from any directory, as Java will search for the program, starting the search from the classpath directories.)
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • Java does not work at all upon using the update manager to update to firefox 3.6.10 for Ubuntu 9.0.4

    OS: Ubuntu 9.0.4
    Browser: Firefox 3.6.10
    upon updating to firefox 3.6.10, java does not work at all.
    websites that use java do not work at all anymore, when they worked just fine before the updating thru update manager. e.g. hulu website cannot play any of the shows.
    i can give the folder of bookmarked pages i tried.
    how to do that on here, i've yet to see if possible.
    i can even give saved text from the terminal concerning certain attempts.
    when i updated thru update manager, it gave some weird java plugin that wasn't there before "The IcedTea Web Browser Plugin IcedTea6 Java Web Browser Plugin (execution of applets on webpages)".
    i uninstalled this as instructed by an answer found in one of the pages i saved, cuz it was conflicting w/another java program the updater said i needed. right now, i don't remember for sure what it was. it perhaps was realplayer flash or Java itself. w/all the hours/days of searching i put in, it's difficult if not downright impossible for me to remember all the specifics of what i tried.
    i've searched throughout many webpages (including many searches on mozilla, ubuntu, java, etc) for instruction in fixing the problem.
    oh, and incidentally, on the Java site, when i try the verify test of Java, firefox pops up with that yellow bar right below the slew of tabbed website windows, giving the statement "additional plugins are required to display all the media on this page. (w/link to) install missing plugins ." which is what i do, go thru the requesting plugin installation. it comes up with, guess what, the IcedTea Java Plugin. i click on the 'next' in the "Plugin Finder Service" box that pops up, & all it gives me is "No plugins were installed. IcedTea ...Plugin failed. and the link 'find out more about plugins or manually find missing plugins'". the link takes me to some of the very things/plugins that wouldn't install in the first place. the Java test failure is a LOL funny, as what plugin it is saying is required (IcedTea) is a recommended alternate program to display the very test in the first place.
    i followed the given instructions on those many searched pages, in every case (barring what i may have just plain missed), but to no avail.
    i've even gone to the point of trying to reinstall the previous 3.5.13 firefox version, from mozilla site. even that wouldn't install.
    i've tried installing Java for my sys direct from it's site. nada.
    now it's time for me to post the problem & perhaps someone will come up with some kind of "dummy" way to fix it.
    until then many sites a regularly use are totally useless to me on this fast puter.
    the only way i can get to use such sites, are two choices: 1. use a dinosaur laptop, which is slower than molasses & cannot handle to any streaming stuff, or 2. use an available internet access puter at the library. but useage for ea person per day is limited to only one hour a day. and one can end up waiting for an hour or more ( in the busiest periods) to even get to use one.
    so, is there anyone at all, who knows any for-sure working fix for this problem?
    thanks muchly :^D
    p.s. i can't pay anybody any money for such help, as is required in certain sites (e.g. Java website), cuz i don't have any.
    i can pay in labor tho, if there is someway to find someone who can physically be at this puter w/me, taking me step-by-step
    sorry for the 20-pg essay. i hope it was all clearly understood. if, not, well, clear communication is always what is needed, ask away.

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • Java Plugin not working with firefox 3.o.13  and linux.

    this is my ln -s to the plugin at /usr/lib/mozilla/plugins
    libjavaplugin_oji.so -> /usr/local/jdk1.6.0_16/jre/plugin/i386/ns7/libjavaplugin_oji.so
    Any ideas why java is not working?
    Here's the ln -s again:
    #pwd
    #/usr/lib/mozilla/plugins
    # ls -l
    lrwxrwxrwx 1 root root 63 Sep 28 20:41 libjavaplugin_oji.so -> /usr/local/jdk1.6.0_16/jre/plugin/i386/ns7/libjavaplugin_oji.so
    Here are my java stats:
    # java -version
    java version "1.6.0_16"
    Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
    Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
    Firefox 3.0.13:
    Mozilla/5.0 (X11; U; Linux i686;
    Gentoo Linux:
    # uname -a
    Linux tma 2.6.30-gentoo-r5 #10 SMP Sun Sep 20 21:52:19 PDT 2009 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
    I installed java from a jdk*.sh file and set the class path in /etc/bash/bashrc (not that it matters.
    The appletviewer does work.

    solved: I knew you all knew I could figure this out.
    #cp -R /usr/lib/mozilla/plugin/ /usr/lib/firefox-mozilla/
    asuming this is true:
    tma plugins # pwd
    /usr/lib/mozilla/plugins
    tma plugins # ls -l
    total 4
    lrwxrwxrwx 1 root root 63 Sep 28 20:41 libjavaplugin_oji.so -> /usr/local/jdk1.6.0_16/jre/plugin/i386/ns7/libjavaplugin_oji.so
    tma plugins #

  • Java 7 not working on new (4/2/13) OS 10.8 machine

    I downloaded Java 7 and the app is not working.
    Checked it on Java site and it is not functioning.
    Validated Java is enabled in browser
    Cleared Cache...
    Not sure what else to do.
    Was going to uninstall and re-install with security off, but am not sure how to uninstall. My first Mac....
    Thanks in advance.

    I had a similar problem running Java with OSX 10.8.3.  Even after performing the latest software update (including Safari 6.0.4) in addition to download and installation of the latest version of Java (version 7 update 21), Java did not work. And the “Java icon” was absent from the “system preferences” menu (should be at the bottom under the tab “other”). Very strange! But I found a solution: 1.) Go to “Library > Internet Plug-Ins”; 2.) Move all JavaAppletPlugins to trash (I moved “JavaAppletPlugin (1.7.10.18).plugin” and “JavaAppletPlugin.plugin”); 3.) Download and run the latest Java update; 4.) re-launch Safari.
    That solved my problem and I can run Java applications in Safari. Again......

  • Java is not working any more

    The last 6 months Java has not worked at all. I have Java 1.4.2 and 5.0 installed. I have tried re-installation, emptying buffers, resettings safari, using other browsers, created new user account in OSX and so on. I have tried all the tricks in the book and I have talked with other people that have the same problem without being able to find a solution.
    My theory is that everything went wrong with the last java update, and I'm wondering whether Apple will release another update also including Java 1.6. I have waited quite long now, hoping for a update, but it doesn't seem to happen. Does anybody have some ideas on what I can do to get Java working again.

    HI punsk and Welcome to Apple Discussions ...
    Since you're having so much trouble with Java, you might consider backing up your files and doing a complete erase and reinstall. Not an Archive and Install, ERASE and start over. Once you do that, go to Software Updates available from the Apple menu; Apple/Software Updates and start from scratch.
    If you do this, after this is finished, run Disk Utility from your Applications/Utilities folder and Repair Disk Permissions.
    Also, on your iBook. Make sure you have available drive space for updates. Open Disk Utility, select MacintoshHD in the panel on the left, then look down right side of window and you'll see:
    Capacity and Available. Make sure your Available drive space is at least 20% of the total drive.
    Carolyn

  • Java 7 not working on OSX 10.8.3

    I need some help with Java 7.
    I am trying to open my photo lab software, however, it keeps giving me a message saying I need to download the Java Runtime Environment. I clicked on the link and it brought me to the Java site. I sucessfully download the software but it still doesn't work even though Java test show's it's working.
    I'm running OS X 10.8.3.
    I downloaded the softwared using Firfox don't know if that makes a difference.
    I've checked my Java setting and they all seem to be enabled. At this point I have not idea whats going on. I didn't have this problem before and can't figure out what to do.

    I had a similar problem running Java with OSX 10.8.3.  Even after performing the latest software update (including Safari 6.0.4) in addition to download and installation of the latest version of Java (version 7 update 21), Java did not work. And the “Java icon” was absent from the “system preferences” menu (should be at the bottom under the tab “other”). Very strange! But I found a solution: 1.) Go to “Library > Internet Plug-Ins”; 2.) Move all JavaAppletPlugins to trash (I moved “JavaAppletPlugin (1.7.10.18).plugin” and “JavaAppletPlugin.plugin”); 3.) Download and run the latest Java update; 4.) re-launch Safari.
    That solved my problem and I can run Java applications in Safari. Again......

  • Java apps not working right

    I lately have found problems with Java apps not working correctly. For example, in Yahoo Widgets I cannot get any widget preferences to display; in Apple's Java Preferences for J2SE 5.0 the preference window opens but is blank; and in JBidwatcher the buttons are missing in main and preference windows.
    When I log in as another user I find all those apps work properly, so it seems to be something wrong within my User folder. I tried reinstalling the Java J2SE50ReIease4 but it didn't help. Is there something I can delete and/or reinstall to fix this problem?

    Ditto here,
    I made the mistake of thinking I could throw away the preferences in the Java folder and new pref's would automatically replace the missing pref's, much to my surprise no such thing happened. My settup is the same as yours, except my OS is 10.4.8.
    Someone please help.
    Thanks,
    BJZTX
    G5 D2GHz   Mac OS X (10.4.7)   G4 Notebook 10.3

  • Java & Flash not working in safari

    Hello Friends,
    why java & flash is not working in safari?
    I have checked Java preferences, tab called general tab, and the checkboxes, both checked. java version run on the termial & it confirmed java by displaying it's version. running perfect.
    The problem is java & flash not working in safari, might be because of , so?
    when ever i open sites like web design company for project i wasn' t able to open such sites...
    kindly guide me for the same.
    Thanks,
    John Millard
    Edited by: 951029 on Aug 6, 2012 4:01 AMJavatester site<a/>, so?
    when ever i open sites like web design company for project i wasn' t able to open such sites...
    kindly guide me for the same.
    Thanks,
    John Millard
    Edited by: 951029 on Aug 6, 2012 4:01 AM

    Flash is totally unrelated to Java, so what you're saying is that certain plugins are not working under Safari of which one just happens to be Java. You're the second one I see make mention of that, but the fact remains that you'd need to ask Apple what is going on with their browser.

  • Java currently not working, but was working previously. Change occurs around updates.

    I need Java to upload info to a GoDaddy website. Java was working in January, then did not work. It worked again after an update, then stopped working about the time of another Firefox update. Currently, Java is not working, but I am able to upload thru Internet Explorer. I seem to have the latest Java for Firefox installed, it is enabled so I am at a lost. Did an update not install properly? I am really at a lost since success and failure seem to be tied to Firefox updates.

    >
    You should be aware that this is a forum for discussion for Java developers. It is not an end user support forum.
    At any rate your issue is a problem with the site in question. "java.lang.NoClassDefFoundError: PChatPanel" means that resources the program needs cannot be found. This is a problem with that site and you will have to address it with them in order to resolve it. Nobody else can help you with this because it is a site problem and beyond our control.

  • Java -version bash: java: command not found

    Hi all.
    I wanna install java on linux (OpenSUSE). When I checked java -version, it shown that :
    java -version
    bash: java: command not found
    Can any solution about it, please!

    Sukirmanster wrote:
    I wanna install java on linux (OpenSUSE). When I checked java -version, it shown that :
    java -version
    bash: java: command not foundNot surprising if you have not installed java yet.
    Can any solution about it, please!If you have installed java, read a unix/linux manual,
    pay particular attention to bash (or any shell) and the role of $PATH.

  • Crontab reboot command not working

    Crontab reboot command not working
    Greetings
    I am new at this so excuse any ignorant mistakes I might be making.
    I have a server (MM X.4.9) that I would like to restart every day in order to make sure no programmes are hanging etc. If a program is hanging is should force quit it. Using terminal I have entered the following command:
    sudo nano /etc/crontab
    Entered password
    Than I entered using tab between each sequence:
    15 13 1 1 * root reboot
    This was a test run and it did not reboot.
    Entering
    cat /etc/crontab
    I got:
    # The periodic and atrun jobs have moved to launchd jobs
    # See /System/Library/LaunchDaemons
    # minute hour mday month wday who command
    15 13 1 1 * root reboot
    What have I done wrong?
    Thanks

    Hehe, there you are experimenting with a "reboot" cron command and you are surprised it quit so fast. You are not going to find a "graceful" solution to shutdown dialogs.
    MSWord is a Java app, so it is especially important for the command to work that it doesn't get hung up on outer layers of the system. Especially stupid apps that use Java which is not well integrated. I believe Word has a 5 minute autosave, so you should be able to recover most of your document.
    This reboot command should be running around 2AM, when the average webserver has minimum traffic. If you feel the need to reboot during busier times of the day, I'd suggest you look at what's causing your applications to crash.

  • [solved] tuxguitar - java: command not found

    Hi,
    I installed tuxguitar via pacman. When I start it I get this error
    /usr/share/TuxGuitar-0.9.1-linux-gtk-x86/tuxguitar: line 27: java: command not found
    this is the content of that file, line 27 is the last one
    #!/bin/bash
    ##SCRIPT DIR
    DIR_NAME=`dirname "$0"`
    DIR_NAME=`cd "$DIR_NAME"; pwd`
    cd "${DIR_NAME}"
    ##JAVA
    if [ "${JAVA}" == "" ]; then
    if [ "${JAVA_HOME}" != "" ]; then
    JAVA=${JAVA_HOME}/bin/java
    else
    JAVA=java
    fi
    fi
    ##CLASSPATH
    CLASSPATH=$CLASSPATH:./TuxGuitar.jar:lib/swt.jar:lib/itext-1.4.5.jar:./share/
    ##LIBRARY_PATH
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:lib/
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/jni
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
    ##MAINCLASS
    MAINCLASS=org.herac.tuxguitar.gui.TuxGuitar
    ##JVM ARGUMENTS
    VM_ARGS="-Xms128m -Xmx128m"
    ##LAUNCH
    ${JAVA} ${VM_ARGS} -cp :${CLASSPATH} -Djava.library.path="${LD_LIBRARY_PATH}" ${MAINCLASS} "$1" "$2"
    the dependencies jre and swt are installed...
    Last edited by SiD (2007-02-23 13:23:49)

    If jre got installed as a dep together with tuxguitar you first have to source /etc/profile as Java resides in /opt and the PATH variable needs to be refreshed.

  • HT1338 I installed Mac OSX Snow Leopard 10.6.3 And now my Java is not working, what can I do to fix's this?

    I installed Mac OSX Snow Leopard 10.6.3 And now my Java is not working,what can I do to fix's this?

    Run Software Update to get to 10.6.8 and update Java.

  • Alt ctrl c shortcut command not working in photoshop cc, it is opening Internet explorer (IE)

    In Photoshop CC 2014  Alt + Ctrl + C ( to open for canvas size dialog box ) command not working, it is opening Internet Explorer (IE)

    What version of windows are you using?
    See if the Internet Explorer shortcut has that keyboard shortcut assigned to it.

Maybe you are looking for

  • Images repository in portal

    Hi, I am planning to configure  Portal welcome screen,Theme and pages with some custom (Client) logos etc. Similar to SE80 in BW, MIME repository Is there any central location I can first save/upload all the images I required in portal and then use t

  • The Firefox menu button (red box top left) has disappeared. How do I get it back

    Win 7 MFF 5 FF red button (Menmu button top left has disappeared How do I get it back Thanks

  • SQL function support within cfquery

    Are all SQL statements supported by <cfquery>? I'm tring to use FORMAT() with no luck. p.s. using MySQL db

  • Rule below overprints descender

    We've been using the rule-below in some paragraph styles that use green type. The rule is tight to the baseline, so the descenders extend past it. On our old template, the green covers the black rule. But we've recently made a copy of that template a

  • Iphoto/icloud/library question

    I am confused about the iphoto features. I thought when I clicked on the photo tab in the library section on the left that was showing me pictures that were saved to the hard drive. But I do see that it says photo stream. What is the difference in th