Message Boards

[java] Error: Could not find or load main class com.liferay.portal.tools.Sa

Aadarsh Choudhary, modified 6 Years ago.

[java] Error: Could not find or load main class com.liferay.portal.tools.Sa

New Member Posts: 8 Join Date: 7/20/17 Recent Posts
Hi There,
I am new to liferay and I am trying to build the first Generic portlet but when I am trying to build the portlet I get encountered with the following errors.
[java] Error: Could not find or load main class com.liferay.portal.tools.SassToCssBuilder.
And when I used to create the generic portlet some predefined errors and warnings are also coming.
In Docroor->WEB-INF->tld->liferay-ui.tld->Description Resource Path Location Type
cvc-identity-constraint.4.1: Duplicate unique value [app-view-navigation-entry] declared for identity constraint "tag-name-uniqueness" of element "taglib". liferay-ui.tld /Demo1-portlet/docroot/WEB-INF/tld line 5588 XML Problem.
Screenshots are attached below
Thanks
thumbnail
Andrew Jardine, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hi Aadarsh,

Can you show us what you have in the css folder?

Also, if you are new to Liferay and starting from scratch, I would recommend using the Blade CLI + Gradle for your projects. It might add some work to your learning curve, but it is the new standard that Liferay is using. At the very least, you should use Maven as that seems to be the way most developers went starting in 6.2. The ANT SDK I think is being use less and less -- it'll likely be the hardest to get support with.
Aadarsh Choudhary, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

New Member Posts: 8 Join Date: 7/20/17 Recent Posts
Ok Thanks, I am working on Liferay Module Project.
Aadarsh Choudhary, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

New Member Posts: 8 Join Date: 7/20/17 Recent Posts
I need help in another thing. I have a web application project built on Html, Css, Js And angularjs. I don't know how to import that project into Liferay Module Project. I want the same web application having css, js and images folder into the project.
thumbnail
Christoph Rabel, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
You can find an angular example project here:
https://github.com/izaera/liferay-npm-examples/tree/master/modules

Maybe this helps you get started.
Aadarsh Choudhary, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

New Member Posts: 8 Join Date: 7/20/17 Recent Posts
Ok Let me check... And Thanks emoticon
Petr Malis, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

New Member Posts: 2 Join Date: 12/4/17 Recent Posts
Hello, Andrew,
as to the Aadarsh's problem: I am now facing the same - I have freshly installed Eclipse IDE (Oxygen) with Liferay IDE 3.1.2 from Eclipse's Markeplace, Liferay CE 7.0ga5 (Tomcat bundle) and Liferay plugin SDK 7.0-1.0.13. When I try to create a new empty Liferay plugin project, which I have done a hundred times before - but on LR 6 development environment, it ends with the same errors mentioned by Aadarsh. IMHO the main complain concerns the liferay-ui.tld file and several duplicated tag names in it - e.g. you can find 6 occurrences of the "app-view-navigation-entry" tag there etc., on which the validation of the file fails.
Well, as usual, any advice is good :-)
Petr.
Petr Malis, modified 6 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

New Member Posts: 2 Join Date: 12/4/17 Recent Posts
PS: I removed those duplicate tags from the file manually and everything seems to be OK. But this could not be the final solution, could it? :-)
Gerald Warp, modified 3 Years ago.

RE: [java] Error: Could not find or load main class com.liferay.portal.tool

New Member Post: 1 Join Date: 9/16/20 Recent Posts
While executing, when JVM does not find a .class file with the specified name then a run time error occurs saying “Could not found or load main class”. The reason why this happens is mostly due to:

* Wrong Class Name
* Invalid Classpath

Main class could not be found when there is typo or wrong syntax in the fully qualified java class name or it does not exist in the provided classpath. You must ensure that you add the location of your .class file to your classpath. So, if its in the current folder, add . to your classpath. Note that the Windows classpath separator is a semi-colon ; .  If you want to execute the main() method in MainClass, you must use the full class name, including package name, in the java command.

http://net-informations.com/java/cjava/default.htm