Home > Could Not > Error: Could Not Find Or Load Main Class Linux

Error: Could Not Find Or Load Main Class Linux

Contents

Here is the output from my [email protected] sample]$ javac HelloHP.java[[email protected] sample]$ java HelloHPError: Could not find or load main class HelloHP[[email protected] sample]$ cd ..[[email protected] hsqldb]$ java dto.HelloHPError: Could not find or For example: public class YourMain extends org.apache.camel.spring.Main If camel-spring is not included, same error will be reported. Update - I made a few changes and got it to work. share|improve this answer answered Sep 14 at 20:00 Duncan X. have a peek at these guys

Really my point is that your answer is adding nothing new ... Error: Could not find or load main class I dont know why??? If you have a CLASSPATH set at all, who set it? Yes, it works in many cases, but it won't in others. –Stephen C Aug 22 '15 at 6:20 @StephenC, It worked for me, and any other solution did not

Error: Could Not Find Or Load Main Class Linux

Could the atmosphere be compressed and put into bottles? because I don't have any CLASSPATH environment variable, neither I am using -classpath or -cp option to suggest the path, So by default Java is only searching in the current directory. In Eclipse, it's easy to compile and run the program because Eclipse takes care of all Classpath setup, but when you run your Java program from command line, CLASSPATH environment variable Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

  1. We need to supply the class name containing the main method to the interpreter.
  2. Kewl ;_; 19,704 views 2:07 EASIEST WAY HOW TO CREATE JAR FILE ( JAVA EXECUTABLE FILE ) - Duration: 8:43.
  3. because Java is still looking into the current directory and there is no .\target\dto\HelloHP.class there, as it's one level down e.g. .\target\classes\dto\HelloHP.class Now let's run the same command using -classpath option
  4. asked 2 years ago viewed 2369 times active 2 years ago Upcoming Events 2016 Community Moderator Election ends in 2 days Related 0“Could not find the main class: bla.bla.yada”, although specified
  5. Americans think that global warming is unproblematic since Christ will return soon?
  6. it shows ..as you said a list of options....
  7. Close the command prompt window, before specifying the path. 2.

I commented out the package statement in the source and added "-cp ." to the java command. I've seen it, so just want to share it here maybe someone else will need it. –XiaoPeng Sep 17 '15 at 1:55 Yes. TechZone++ 15,455 views 10:05 Defining Class in Java (HINDI/URDU) - Duration: 21:43. Error Could Not Find Or Load Main Class Java when i compile them ...

dto.HelloHP My first program in Java, HelloWorld !! Should I have doubts if the organizers of a workshop ask me to sign a behavior agreement upfront? it is not showing any error message but when i tried to run them(by using java command in command prompt) iam getting error message as "Error: Could not find or load So in the first try, I go there and execute java command to launch my program, as seen below: C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>java HelloHP Error: Could not find or load main class HelloHP

Hello, I am getting "Error: Could not find or load main class Server" on Eclipse. Error: Could Not Find Or Load Main Class Eclipse package dto; /** * Simple Java program to demonstrate following error * Error :Could not find or load main class * * @author Javin Paul */ public class HelloHP { public What's a word/phrase like "compulsion" or "addiction" that is more about guilt than physiology or anxiety? Loading...

Error Could Not Find Or Load Main Class Command Prompt

ICT Trainer 2,395 views 7:42 How to Fix the Error could not find or load main class info.mineshafter.GameStarter - Duration: 3:04. So let's correct this error and try to run the same command from the same location but this time with fully qualified name: C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>java dto.HelloHP Error: Could not find or Error: Could Not Find Or Load Main Class Linux LearningLad 24,689 views 6:27 How To Compile A Java Program With Javac - Duration: 2:44. Could Not Find Or Load Main Class Jar Linux D:\stuff\prgms>javac hello check manually whether hello.class got created in that folder then D:\stuff\prgms>java hello and as John said, java.lang in base package for java...

It also has full permissions on the program path and it has execution permissions on the java.exe path as well. http://venamail.com/could-not/could-not-find-libjava-so-aix.html What was wrong with the original code?Here is some output:[email protected] sample]$ cat HelloHP.javapackage HelloHP;/** * Simple Java program to demonstrate following error * Error :Could not find or load main class From HelloTest!! "); } } And i use maven assembly plugin to package this program as a runnable jar, the jar package structure as follow: Test3-0.0.1-assembly.jar |-----META-INF | | | |---MANIFEST.MF How do I convert a SharePoint Add-In .app file to a .wsp file? Error Could Not Find Or Load Main Class Shell Script

Hot Network Questions Output tab character on terminal window What are 6 colors which are also well-distinguishable in grayscale? Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the does solution given here helped you? check my blog There are many waysError: Could not find or load main class HelloWorldmanifests itself, but if you know the basics of Java Classpath, you caneasily sort out the problem.

Watch Queue Queue __count__/__total__ Find out whyClose error : could not find or load main class Test.java JavaProgrammers SubscribeSubscribedUnsubscribe127127 Loading... Error: Could Not Find Or Load Main Class Scala I was able to execute the program but after removing the package name from the program file. September 23, 2016 at 1:01 AM Madhushree Madhu said...

Not the answer you're looking for?

I then opened a terminal window, went to where I saved the file and compiled it from the command line. There you type the following command line: [name of the package].[Class Name] [arguments] Let's say your class is called: CommandLine.class and the code looks like this: package com.tutorialspoint.java; /** * Created more hot questions question feed lang-java about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation How To Set Classpath In Java October 25, 2015 at 11:19 AM Javin Paul said... @raghu, what error are you getting, can you post your error here?

NoClassDefFoundError and ClassNotFoundException and this is my humble effort to bring them back and empower with practical knowledge. Living on an Isolated Peninsula - Making it Impossible to Leave Do American foods contain unsafe levels of glyphosate What is the maximum interception angle for ILS when on radar vectoring? more hot questions question feed lang-java about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation news Finding Residue Why do Internet forums tend to prohibit responding to inactive threads?

John Jai Rancher Posts: 1776 posted 5 years ago You are welcome cp is an option to specify the class path - the path where to find the class files. Watch QueueQueueWatch QueueQueue Remove allDisconnect The next video is startingstop Loading... The problem was that >>you<< narrowed in on the wrong clause.) –Stephen C Nov 7 at 22:42 @StephenC what I meant is, they surely have access to the information I had to find this out the hard way, it was a referenced library that I moved and it gave me the: Could not find or load main class xxx Linux

Try java -cp . the right class name, but in the wrong form.) Considering the example above, here a variety of wrong ways to specify the class name: Example #1 - a simple class name: I have been wading through tons of Java doc and this concrete example is what I needed –user2044223 Mar 17 '15 at 19:05 Its better to make 'Runnable JAR solved my issue w/o a fuss, thanks:-) August 9, 2016 at 7:44 PM Javin Paul said... @dArch, thanks!!glad to know that it help you to solve your issue.

Ask Ubuntu works best with JavaScript enabled current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list.