Run a program in Java

sima88 Posted messages 93 Status Member -  
sima88 Posted messages 93 Status Member -
Hello

I can't execute my Java program on Linux, a message appears for any program I try to run:

 root@admine:/home/admine/Bureau/java# java tcpclient Exception in thread "main" java.lang.NoClassDefFoundError: tcpclient Caused by: java.lang.ClassNotFoundException: tcpclient 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:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332) Could not find the main class: tcpclient. Program will exit. 


It's really urgent, please help me
Thanks in advance!
Configuration: Linux / Firefox 3.5.9

3 answers

mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 940
 
Well, apparently the support for the java tcpclient class is not present on your system. Start by updating your JRE.

Java is not my specialty, but if we are to believe what is here:
http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-sun/security/sun/security/krb5/internal/TCPClient.java.java-doc.htm

... you would need a java6. Under debian here is the package you would probably need to install:

(mando@aldur) (~) $ apt-cache search java | grep java | grep jre | grep 6 sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)


... with the commands:

aptitude update aptitude safe-upgrade aptitude install sun-java6-jre


Then I suppose your program should start correctly...

Good luck.
0
ben51 Posted messages 238 Registration date   Status Member Last intervention   33
 
If your Java program has a .jar extension, you need to do
java -jar my-program.jar


Otherwise, under Linux, Open JDK is more recommended than Sun Java 6 (unless you want Java in Firefox 3.6)
Free software is open source, but open source software is not necessarily free.
SMS has spelling mistakes, but spelling mistakes are not SMS ;)
0
sima88 Posted messages 93 Status Member 1
 
Thank you, I will do it now!
0