trying to compile and run java through the terminal
Hey everybody,
Ok here is my problem. I have this code that that compiles, but when i go to run it it gives me errors.
I stored my simple java class here:
/user/workspace/getMailFromSafeDoc/src
I store my mail.jar file here:
/user/workspace/getMailFromSafeDoc/lib/javaMail/javaMail.jar
In my terminal i go to that folder and i compile it by:
javac -classpath ../lib/javaMail/javaMail.jar javaMail.java
..... this works and products a class file with no errors.
when i go to complile it by:
java javaMail
i get:
Exception in thread "main" java.lang.NoClassDefFoundError:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/NoSuchProviderException
Caused by: java.lang.ClassNotFoundException: javax.mail.NoSuchProviderException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
When i take out all the try and catch, it works fine.
Hello!
This is my first post, and I just learned what UNIX was this week. For a JAVA programming class I am taking, I must be able to create a directory in UNIX, use the nano command to create a JAVA program, compile it, and then run it on the command prompt using the java command.
For some... (5 Replies)
Hi
Im using MobaXterm Unix on my windows XP.I want to compile java in unix.I have installed java to the following path C:\Program Files\Java\jdk1.7.0_09\bin
In order to compile the java prog im typing the following command after entering into the bin directory:
C:\Program... (2 Replies)
If I run 'who -u' interactively or from a script invoked through bash in a tty on my Ubuntu 12LTS box I get an output like this:
testuser pts/0 Dec 9 02:32 . 2163 (host.xx.yy)
running the same through cron I get:
testuser pts/0 2012-12-09 02:32 00:05 2163... (2 Replies)
What is the trick to get a java program to run and compile? I can't even get a basic skeleton to run and compile. What packages do I need? I figured the java-gcj and gcc-java packages was enough. Do I need any other packages?
I thought I had to do this and it would work but its not.
javac... (1 Reply)
Hi,
I have a program which collects performance data from AIX. It works fine on older releases (< 5.3) but I fail to get data from /proc.
I would really appreciate it if someone could compile (using ANSI compat C compiler), run the program (for 30-40 minutes) on AIX 6.1 and send me the... (2 Replies)
The java program is a part of speech tagger -> The Stanford NLP (Natural Language Processing) Group
The goal is to use this script as part of a webpage to tag parts of speech based on a user-inputted string.
I have no idea what to do with the files - I'm a complete *nix noob. I tried running... (4 Replies)
Hi,
I have installed Solaris 10 on a VMware. How to compile a java program as there is no javac in 'bin' directory. Thanks in advance for answers and sorry if the question is soo basic. (3 Replies)
hi
there is example (on link given below )of such code that contains java class reference in c++ program.
http://slackware.cs.utah.edu/pub/slackware/slackware-7.1/docs/Linux-HOWTO/Process-Monitor-HOWTO
I am new in linux environment. and not able to compile it.
when i compile it through... (1 Reply)