Help running Java apps in Mac OS 10.1.3

I'm currently taking an intro course to Java and I've been using the OS 10.1.3 Unix Shell to compile and run my assignments, using the "javac" command to compile my classes and the "java" command to run them. It's been working fine until a few days ago when every class I started to compile from that day on wouldn't run. The previous classes I've compiled run fine, however if I re-compile them and attempt to run them I incur the same problem.
I get this error :
Exception in thread "main" java.lang.NoClassDefFoundError:
followed by the classname.
The best I can figure is that I've accidently changed some option in the java system, but now I have no idea as to how to change it back. I've asked my CS professor what to do but ofcoarse he's a PC user and when he hears Mac he just replies "I don't know about Macs" eventhough I've tried telling him that OS X is unix based. Anyways, if there are any well informed Mac OS 10.1.3 users out there, please help me so that I can resume my CS assignments on my Mac.
Thanks,
Craig

1. Are you certain that you have all of your java files compiled
and that their class files are in your classpath? Did you import
the class TestWeeklyEmployee in your java file that has your
main method? Do all of your class filenames have the same
name (minus the .java or .class) as the class in the file?All of the java files needed to run the class are in the same directory, and they all have the correct names, You see I'm able to run my programs perfectly on other machines, infact I have to test them in the computer labs before I turn them in. So I know that my probrem isn't a syntax error.
2. when you start the terminal, type the following:
echo $CLASSPATH
and make sure that the output it gives has the . [dot] that you
added via the .cshrc file at the end or that only a dot gets
displayed. If it does not have your dot in the output, then you will
have to use the -classpath option to the java runtime binary to
tell it where your classes are located.I tried typing echo $CLASSPATH but I got this error message:
CLASSPATH: Undefined variable.
And I had directly copied the code you wrote into my .cshrc file.
3. When you try to run your java program, are you sure that you > are in the directory where all of the class files are located? use
the "ls" command to see if your class files are in the current
directory. (you may want to search the web for a UNIX tutorial or
a UNIX for beginners type of article so that you can feel more
comfortable using the Terminal application)Yes all of my classes are in the same directory and yes I'm in the correct directory when compiling and attempting to run my programs.
4. Assuming that 3 is true: If you run your program using the
"java -classpath . MyClassWithAMainMethod" do you still get an
error? If you do, then I am pretty sure that you have neglected to
import a class that your main method is trying to instantiate or
that you have not compiled the source of the class in question >
(or both).All classes are imported correctly and yes I have compiled the class. As I said it works fine when I compile and run on other machines, just not mine.
Are you trying to install the developer tools from the developer
cds? If you are and you have since updated your OS to 10.1.x,
then I would not expect project builder to work. The same thing
happened to me when I upgraded to 10.1.x. Sounds like you
may need to install the latest developer tools which can be
downloaded for free from the Apple Developer Connection site
(http://www.apple.com/developer). Installing the latest developer
tools should get things right for you.The developer tools that I'm attemping to run are not from the CD, they're the current downloadable version from apple developer. I've contacted apple developer support with my problem with project builder, but they blew me off.
So now that we've eliminated these possibilities, any other ideas?
Thanks,
Craig

Similar Messages

  • Errors running Java app on Mac OSX

    Hello,
    I've written a Java application and packaged it as a JAR file that runs fine on Windows. When I try to run it on
    Mac OSX, though, I get the following error:
    % java -jar Clavis.jar
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java/awt/KeyEventDispatcher
    at Clavis.main(Clavis.java:7)
    I'm assuming this means that the program needs and is somehow not getting access to the java.awt.* classes it requires. How can I tell it where they are? Is it possible to do this within the JAR file so that users don't have to configure this manually?
    Five dukes for the first good answer!
    Thanks much--
    David

    From Apple's Java FAQ:
    Q: When will Apple have an implementation of J2SE 1.4 available?
    A: A Java 1.4 Developer Preview was released at WWDC2002 to all seeded ADC members. This pre-release has only been qualified against the WWDC Jaguar seed, and has not been qualified against any other seeds/builds, including the final release of Mac OS X 10.2. It is for this reason that the WWDC preview has remained unavailable to ADC members, even though Jaguar has shipped.
    The product development cycle includes plans to seed an additional, more complete prerelease version of J2SE 1.4.1 to developers. Specific dates for releases have not been determined and are in part dependent upon Sun's release schedule. Please note that J2SE 1.4.x will not be available in any form for versions of Mac OS X prior to 10.2.
    If it follows the same pattern as past releases, the answer to your question will probably be months, albeit a low number of them, from Sun's official release date of 1.4.
    -SC

  • How to run Java App in Jar file

    I can run Java App jar-ed into 1 jar file with java -jar App.jar
    But sometimes I need to jar only the app and bind the other classes from different place. So I tried to use:
    java -classpath c:\utils.jar -jar App2.jar
    where classes in App2.jar link to utils.jar. I just can't make it work. Any idea/help.
    thanks
    -ho

    hi HasanOen
    u need to edit the manifest file in yr JAR file u can do this by using the following cammand or by making the batch file but make sure all the files are in same folder.
    first of all u need to make a text file like below
    /////////// first file name: "THIS.txt" /////////
    Manifest-Version: 1.0
    Created-By: java // whatever here
    Main-Class: PUT YOUR MAIN CLASS NAME HERE (like MAIN)
    //////////////////// BATCH FILE "RUN.bat" //////////////
    jar cmf This.txt App2.jar MANIFEST.mf com
    com is the folder where your all the class file are.
    now double click the run.bat file. this will edit yr manifest file.
    hope this should work for u
    Note : Make sure yr jar file, txt file, bat file, and yr classes folder is in the same folder(I mean at same level)
    regards
    Satinderjit

  • HT1338 how can i run java on a Mac OS version 10.6.8?

    My company runs it's email and agent portal through Java, wen I wen through the Java web page to download the software
    it sends me to apple support, does anybody have an idea of how to run java on a Mac book Mac OS v10.6.8?
    help me please my job is depending on this.

    Since August 2012 updates for Java (and especially Java Runtime Environment, which is what you actually need) must now be downloaded direct from Oracle:
    http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.h tml
    Further information here:
    http://www.oracle.com/us/corporate/press/1735645
    and their FAQ’s:
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mac-faq.html
    However, if you need the Jave 6 JRE and plug-in, MadMAC0 has posted at
    https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182
    Apple has also posted (Oct 22/12) the approved solution for restoring the Java 6 plug-in:
    Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.

  • What is needed as a minimum to run Java apps?

    Hello,
    I'm running Windows 2000 Pro on a home computer and want to conserve disk space. There seem to be a lot of duplicate files in Java directories on my system. I only want to be able to run Java apps - no development or deployment. What is the minimum installation required to just run apps?
    I currently have J2SE Runtime Environment installed.
    Thanks in advance,
    Kudzuken

    I could get all technical and fancy on you, tell you about jre's that can run on palm pilots and such, but nevermind that stuff.
    The answer is that the java 2 runtime environment is all you need
    Be careful about moving and deleting files tho
    Hello,
    I'm running Windows 2000 Pro on a home computer and
    want to conserve disk space. There seem to be a
    lot of duplicate files in Java directories on my
    system. I only want to be able to run Java apps -
    no development or deployment. What is the minimum
    installation required to just run apps?
    I currently have J2SE Runtime Environment installed.
    Thanks in advance,
    Kudzuken

  • Running Java app when java not installed

    I need to run java apps on a server I don't control and the admin will not install java. :(
    Tried a few things to run java without installation, but get error that a java registry item can not be found. "Error opening registry key 'Software\JavaSoft\Java Runtime Environment'" Might be that without control of the registry, there's no way to run the java engine, but curious if there's a way to get it to run... I'm gonna play around with it, but figured if someone out there knows it's not possible, they could save me time by letting me know.
    Thanks!

    Depends on what you want to run. To run an applet on the computer requires that the JRE be installed, as the applet needs the Java Plug-in and Registry keys that the JRE install includes. To run a Java program from the command line needs a copy of the JRE, but it does not need to be "installed" by the Java installer. Then the command "java ... classname" needs to include the full path to the java executable that the JRE contains.
    There might be websites that allow you to run certain kinds of Java programs on the website. I don't know if they still wxist. I also doubt that they'll run applets.

  • Run Java App in a CD

    Hi. I want to develop a java application that can be run from a CD... No installation required. The idea is to distribute an application that users will be able to use by just running the java app in a CD. Can this be done? Can this java app in CD run on windows, linux, and mac?
    Please help... I am new to java and some sample codes or procedures/steps will be a big help.
    Thanks!

    No the dbf route doesn't have SQL (unless you're willing to pay for propitiatory database drivers), but you read it in row by row and then pull out the columns you want. You could create several dbf files on the CD which would be like different select statements. I only mention this because .dbf is probably easier than an embedded database. Take a look at the API. (I highly suggest going this route if possible it will simply development) .dbf files are just a spec, so they would work on linux.
    http://www.svcon.com/jdbf/docs/index.html
    If you feel you really need to be able to create select statements take a look at :
    http://www.oracle.com/database/berkeley-db/je/index.html
    Message was edited by:
    ZimmerS1337

  • Run Java App as a Windows Service

    Hi,
    Is there an easy way (without 3rd party software) to run a Java app as a service in windows?
    Sorry if this isn't the right forum to post to...
    Any help would be greatly appreciated!
    Thanks in advance!

    Nope there isn't. And there also isn't a reason not to use 3rd party software as there is an excellent open source API to do this job: Java Service Wrapper.

  • Problem running java applications on Mac Mini.

    Hi all.
    I have a Mac Mini. Days ago, I started having problems running java applications. Right now, I can not run any java application or even a plugin into a web page.
    I downloaded and reinstalled java from Oracle website, but the problem remains unsolve.
    Anyone can help me?
    Thanks in advance.
    Carlos.

    azofra1 wrote:
    Hi all.
    I have a Mac Mini. Days ago, I started having problems running java applications. Right now, I can not run any java application or even a plugin into a web page.
    What error indications do you get? You have to enable error logging in the Java Control Panel to see the details.

  • Help Migrating Java app to Weblogic 9.2 and Workshop -- startup errors

    I need a little help getting my application up and running in Workshop. I recently migrated to Weblogic 9.2. Before I downloaded Workshop, I installed Weblogic 9.3 and have successfully setup and deployed the app on my PC outside of Workshop. The application is packaged as an EAR – I have extracted the war file and other contents from the ear onto my PC in order to do the deployment.
    In Workshop, I have setup the application as a Java project, have pointed to the source code and required libraries, and have been able to successfully compile the application. I have setup a ‘run dialog’ with similar parameters as in the config.xml and other configuration files.
    The problem I am currently having is when I start the application in Workshop, it is asking for a username. I have tried to enter the username that I setup with the original deployment (before I installed Workshop) and it does not accept it – it always shuts down.
    How can I either make it not require a username, or else use (point to) the same startup configuration as my original deployment, from before installing Workshop?

    On Tue, 5 Jun 2007 05:30:09 -0700, Paul Harvey <> wrote:
    I've been unable to find clear, authoritative information on this...
    I have an app which requires Java 1.4.x. Should I be able to deploy
    it on WL 9.2, or does 9.2 only support apps written in 1.5?WL9.2 has a Java 1.5 JVM. That should run Java 1.4 programs just fine.
    Tim Slattery
    MS MVP(DTS)
    [email protected]
    http://members.cox.net/slatteryt

  • Built Bonjour-dependent Java app on Mac, copied to Windows, can't find Bonjour

    On my Mac, I wrote a Java app that uses Bonjour.  It works just fine.
    Then I decided to test it on Windows.  So I installed Java SE and then the Bonjour for Windows package on Windows XP.  When I try to run my program (double-clicking the jar file), nothing happens.  When I do it from the command line, it complains about being unable to find Bonjour:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/apple/dnssd/BrowseListener
    I assumed that Bonjour for Windows would automatically register itself so that Java could find it.  Is that incorrect? 
    What is the correct portable way to make Bonjour available to apps on Windows?
    Thanks!

    The sad part is that the guide you link to contains a link to the installation instructions right at the top. That should have been a big hint.
    To prevent future wrong assumptions, refer to the roadmap:
    http://www.oracle.com/technetwork/java/javafx/overview/roadmap-1446331.html

  • Running windows apps on mac

    Does anyone out there have any suggestions as far as running windows based programs on a mac.... I am new to the mac community... Also, what do you guys (and girls) think about parallels?

    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
    1. Install the Apple Boot Camp software.  Purchase Windows XP w/Service Pak2, Vista, or Windows 7.  Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows.  Boot Camp enables you to boot the computer into OS X or Windows.
    2. Parallels Desktop for Mac and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  Parallels is software virtualization that enables running Windows concurrently with OS X.
    3. VM Fusionand Windows XP, Vista Business, Vista Ultimate, or Windows 7.  VM Fusion is software virtualization that enables running Windows concurrently with OS X.
    4. CrossOver which enables running many Windows applications without having to install Windows.  The Windows applications can run concurrently with OS X.
    5. VirtualBox is a new Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris.  It is not as fully developed for the Mac as Parallels and VM Fusion.
    6. Last is Q.  Q is a freeware emulator that is compatible with Intel Macs.  It is much slower than the virtualization software, Parallels and VM Fusion.
    Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.
    You should choose whatever method of running Windows that would work best for you. Don't ask people's opinions of what to use here. Do you own research. There is plenty of information you can search out on Google that provides the information needed to help with the decision.

  • Running jave apps in web browser

    Hi,
    I'm (very obviously) new to java.
    Longer term I'm looking to develop a distributed application using java. I recently saw a java app that ran in a clients web browser. I assumed that the browser was using java applets, it wasn't. The web page I was looking at clearly had functionality on it that was well beyond that which could be produced by an html page.
    I was told by the person showing me the web page that when the user hit the URL the system would download and install "jar" files if they weren't already installed and the application would run.
    The page had on it a table (datagrid) which could be sorted by clicking on any of the table headings.
    Being new to java I'm unsure what this technology is, if it is not an applet, and how it works. Is anyone out there able to give me a brief high level description of what particular part of the java technology this is (does it require J2SE or J2EE).
    Many thanks...

    1) The "grid" is a JTable component, which is available in applets, providing the plug-in/JRE is of a more recent (1.2+) vintage.
    2) Applets are not HTML - they're little Java programs, which means they can use Swing, which is a much richer UI environment than any HTML page (including DHTML). See #1
    3) Applets are embedded in HTML pages, so they kinda look like they're part of the page, just like using a TABLE tag.
    4) Current JRE/plug-ins cache the applet JAR files, so it's easier to start next time you run across that page.
    5) Web Start is another distribution option, wherein the JRE/plug-in is used to retrieve and update "fat" (stand-alone) applications via a web site, but the browser is not required to run the application. The only time the browser is involved is on the initial download of the application.
    6) J2SE downloads include Web Start.
    Methinks you'd be better off studying and understanding the Java technologies better before you decide you're going to use it...

  • Run Java app on Time

    I've created a standalone Java app that must run at certain times in the day, can anyone recommend how the best way to do this is, its going to run on a windows box!!

    i would suggest you get some scheduler to do this for you. windows comes with one of these (programs > accessories > System Tools > Scheduled Tasks)

  • How do I run java app when user calls a number?

    Hi all
    Is it possible to run a java app everytime a user calls a number? It has to run before the call is placed. The app will do its job and then place the call using PlatformRequest().
    Thanks
    hsogra

    Hi,
    I believe in general this is not possible.
    J2ME was designed in such a way that J2ME apps don't have permission to interrupt the normal functions of the phone (making/receiving calls, sending/receiving SMS).

Maybe you are looking for

  • SAP R/3 integration with (Manual) Third-party App

    Hi All I am working on a scenario in which Third Party application has functionality which actually refines & correct the data upto the accuracy of 99%. So for this end-user needs to enter bit of information on their front-end then application will r

  • [b]Help in calling web services method[/b]

    i doing at client side now. iwish to call the method which provide by axis. here is my code.... import hotel.*; //normal servlet package import import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import java.text

  • My wifi has never worked

    Hi, so for some reason, my wifi refuses to connect to the server. It's a brand new phone. My router is working correctly, as I can access the net on my computer. I try to load a page, and an applet pops up saying "page cannot be found. cannot connect

  • Re-linking a CD

    When I uploaded Disc 3 (out of 4) to the new Joni Mitchell Album, there was a choice to click "Joni 3" or "Love Has Many Faces."  I accidentally clicked Joni 3.  This made the third disc show up as a separate album.  When I renamed it to Love Has Man

  • Could you anyone guide me how to capture no. of incoming request in weblogi

    Could you anyone guide me how to capture no. of incoming request in weblogic?