Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

impossible to find or load a principal class  RSS feed

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i work with eclipse oxygen i write two program one server and other client and i want to execute then with cmd windows i use the version of jdk 1.8 the javac name of program pass successful but when i execute the program with java name of program it generate an error Impossible to found or load the pricipal class someone help me how i solve this problem taking on consideration that i configure the variable path system giving the chemin to directory bin of jdk.
 
Saloon Keeper
Posts: 5475
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without any punctuation, the post is hard to make sense of.
 
Marshal
Posts: 24460
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The PATH system variable enables the Windows system to find the Java JRE. The CLASSPATH system variable allows the Java JRE to find Java classes.

Looks like you have the first part set up correctly but not the second part.

Also, in future it would help if you told us the exact error message and not just your memory of what it was. Use the copy and paste keys to transfer the actual message to the box where you are posting your question here on the Ranch.
 
Saloon Keeper
Posts: 10206
216
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NEVER set the CLASSPATH system variable. It is asking for trouble. Always provide the class path to the compiler or JVM directly, or through a JARs manifest.
 
Sheriff
Posts: 21741
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even worse is using the JRE extension mechanism, which allows JARs to be available by putting them in <jre>/lib/ext. That's just asking for problems, because JARs in this folder have precedence over JARs on your class path. We recently had a class loading issue with Bouncy Castle which we discovered was caused by an older version in <jre>/lib/ext.
 
Marshal
Posts: 64471
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if you uninstall Java® and leave those .jars in the lib directory? And then install a newer version of Java®?
 
Rob Spoor
Sheriff
Posts: 21741
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea. They may be removed by the uninstaller, but I think it's more likely they will remain in place. If they do remain, then the installer will most likely leave them in place, and you end up with a newer Java version with the same libraries in <jre>/lib/ext.
 
Campbell Ritchie
Marshal
Posts: 64471
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . but would the lib directory be copied from the old installation to the new?
 
Rob Spoor
Sheriff
Posts: 21741
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you install the new version in the same folder as the old one it probably will be left intact.
 
Campbell Ritchie
Marshal
Posts: 64471
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . .but you would usually get a new folder for a new installation. Depends what you do about setting a PATH. That could cause some really interesting problems.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!