• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not find or load main class java Run time error  RSS feed

 
Matthew Yeend
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Java class called Xj3DTest and when I run it, I get the following run-time error:



And in executor-snippets is:



Also, I've been getting an error saying that SEVERE: Native code library (32 and 64 bit library) failed to load: java.lang.UnsatisfiedLinkError: no odejava in java.library.path
java.lang.UnsatisfiedLinkError: no odejava in java.library.path and I've done some research and found that System.getProperty("sun.arch.data.model") helps, but I've not found where it goes. I'm using Windows 10 and Netbeans 8.1. I found System.getProperty("sun.arch.data.model") here. I've found what to do with it and I've made a new project to see what the bitness of Netbeans 8.1 I have and it's 32 bit, the reason why I made a new project was because I carried on getting the error above whenever I run the project.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you run that app from the command line with the java command? Which directory is the class with the main method in, and what is it called? What is the content of your CLASSPATH when you run the app? How did you set the CLASSPATH?
 
Matthew Yeend
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how I'd run it from a command line as I'm using Netbeans 8.1 and when I want to run it, I press the'Run' button at the top. The project that I'm wanting to run, that's producing the error and has the main method in is called Xj3DTest and the directory is C:\Users\matt\Documents\NetBeansProjects\Xj3DTest. And in the VM Options, I have setup the jars that I need with the following:
And with the DLLs, I used the following:
The reason why I have both of those in is because I was unsure of which one to use.
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's look at the last problem first. To determine your processor type in Windows 10, go to:

Start--> Settings -> System -> About

Look for Processor on the right. If it says Intel, then you need the DLL ends with "x86 64". If it says AMD, you need the other one. Also look at System type to make sure you have a 64-bit processor.

 
Matthew Yeend
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The processor type that I have on Windows 10 is Intel so would I need the dll that's named "odejava64.dll" that's found in the "x86_64" sub-directory?
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds correct.
 
Matthew Yeend
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'd have to use the line:
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?
 
Matthew Yeend
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've managed to get rid of that error, but since doing that, I've got some more errors detailed here
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!