ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've installed jdk on freebsd but when i run java, it returns java.lang.* no class
found for the slightest prog.
On linux, it works fine, i only need to specify my personnal classpath.
Does anyone know where the java internal-classes are located? And how they are named: I found no path of the form /usr/.../java/util/ (in linux or free).
You will never need to know where the inbuild classes are located. Your problem is actually the matter of the Java compiler couldn't find your main class. Make sure you specify the classpath to the folder your main class exists or go to the same folder and run it.
Last edited by moeminhtun; 02-19-2004 at 03:19 AM.
All the classes are located in a jar file. I think the file will be rt.jar, but check out all the jar files inside your java installation directory. The file will be quite large, maybe > 20 MB. But to access it just set CLASSPATH to the directory and the java compiler and interpreter will find it .
For example, if it is /opt/blahblah/*.jar then set CLASSPATH to this path and export it .
I did all what you said UltimaGuy, but the problem remains.
classpath is loaded , i checked with echo. try all possibilities *.jar & wrote down the full name.jar for all the lib .jar files. I gave full access to all the linux-jdk files, nothing changed. cannot execute my java progs.
I think you need to specify your main class in a manifest file inside the jar file to make the jar file executable. Then you can run it as:
java -jar app.jar
Your jar file should have a manifest file inside it adding a line similar to this should solve your problem, that is unless you have other class-path problems:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.