Java noob - help setting up eclipse

  • Java
  • Thread starter Hercuflea
  • Start date
  • #1
Hercuflea
596
49
Hello and thank you for putting up with this noob question.

The directions on the website or anything I have found on the internet are not very descriptive.

I have downloaded Eclipse and Java JDK version 7 and successfully installed both of the applications on my computer, but I must have missed something.

My code is perfect and has zero red lines, but when I try to run it I get this error:

"Error: Could not find or load main class org.eclipse.persistence.internal.libraries.asm.util.ASMifierClassVisitor"

I am not a computer programmer but I am just using what I have learned in my first computer science class to do a physics project. Please help me get this stupid program set up so I can have my project done by the due date.
 

Answers and Replies

  • #2
gabbagabbahey
Homework Helper
Gold Member
5,002
7
Hello and thank you for putting up with this noob question.

The directions on the website or anything I have found on the internet are not very descriptive.

I have downloaded Eclipse and Java JDK version 7 and successfully installed both of the applications on my computer, but I must have missed something.

My code is perfect and has zero red lines, but when I try to run it I get this error:

"Error: Could not find or load main class org.eclipse.persistence.internal.libraries.asm.util.ASMifierClassVisitor"

I am not a computer programmer but I am just using what I have learned in my first computer science class to do a physics project. Please help me get this stupid program set up so I can have my project done by the due date.

I've never encountered that issue before. When you say that your code is "perfect", do you meanthat you can compile and run it from a shell without issue? If so, you may want to ask about your problem in Eclipse's newcomer forums (see here.

What OS are you using? What version of Eclipse? Can you post a screenshot of the error?
 
  • #3
Hercuflea
596
49
Hello and thank you for the reply.

This code ran perfectly at my school so there is something wrong with how my computer is set up. It is a Windows 7, most recent version of eclipse (I clicked the one with the most downloads, I think EE), and Java JDK version 7.

Code:
public class PhysicsProject {
	public static void EulerMethod(double angdegree) {
		System.out.println("For angle: " + angdegree + " degrees.");
		
		double theta = Math.toRadians(angdegree);
		double vinx = (255) * Math.cos(theta);
		double viny = (255) * Math.sin(theta);
		final double deltat = .05;
		final double g = 32;
		final int increment = 208;

		double[] vx = new double[increment];
		double[] vy = new double[increment];
		double[] xpos = new double[increment];
		double[] ypos = new double[increment];

		vx[0] = vinx;
		vy[0] = viny;
		xpos[0] = 0;
		ypos[0] = 0;
		
	
		for (int i = 1; i < vx.length; i++) {
			vx[i] = vx[i - 1] + deltat * (-.25 * vx[i - 1] - .247 * vy[i - 1]);
			vy[i] = vy[i - 1] + deltat * (-.25 * vy[i - 1] + .247 * vx[i - 1] - g);

		}

		for (int i = 1; i < xpos.length; i++) {
			xpos[i] = xpos[i - 1] + deltat * vx[i - 1];
			ypos[i] = ypos[i - 1] + deltat * vy[i - 1];

		}
		System.out.println("xpos");
		for (int i = 0; i < xpos.length; i++) {
			System.out.println(xpos[i]/3);
		}
		
		System.out.println();
		System.out.println("ypos");
		for (int i = 0; i < ypos.length; i++) {
			System.out.println(ypos[i]/3);
		}
	
	}
	
	public static void main(String[] args){
		EulerMethod(4);
		System.out.println();
		EulerMethod(6);
		System.out.println();
		EulerMethod(8);
		System.out.println();
		EulerMethod(10);
		System.out.println();
		EulerMethod(12);
		System.out.println();
		EulerMethod(14);
		System.out.println();
		EulerMethod(16);
	}
}
 

Attachments

  • JavaError.jpg
    JavaError.jpg
    24.1 KB · Views: 468
  • #4
coalquay404
217
1
Your code compiles and runs fine here.

My guess is that when you made your new project in Eclipse, you probably selected the wrong project type. Typically, you'll want to use New Project -> Java Project, *not* any others since this may introduce dependencies that you haven't satisfied.

By the way, you're almost certainly not looking for Eclipse EE. Eclipse Classic or Eclipse for Java Developers are both more than sufficient for your needs.
 
  • #5
36,855
8,888
By the way, you're almost certainly not looking for Eclipse EE. Eclipse Classic or Eclipse for Java Developers are both more than sufficient for your needs.

I'm guessing that "EE" stands for Enterprise Edition.
 
  • #6
Hercuflea
596
49
I think I might just uninstall eclipse and retry again.

Is there some process that I am missing when installing?

1: Install Eclipse
2: Install Java JDK (where does it go?, and can you do this from inside eclipse?)
3: Install Java documentation (where does it go?)
4: Start programming?

edit* The project type is a Java Project. So I really have no idea what's wrong.
 
  • #7
Edgardo
705
15
Here is a youtube video that shows how to install Eclipse on Windows:
 
Last edited by a moderator:
  • #8
harborsparrow
Gold Member
655
174
Have you been able to compile any other Java program, or is this the first one?
 
  • #9
harborsparrow
Gold Member
655
174
Install the JDK FIRST and let it install at the default location. Make sure you get 64-bit or 32-bit correct if using Windows. Then, after that, try installing Eclipse. Go into Eclipse' settings afterwards and verify that it has found your version of Java. They try running Hello World first.
 

Suggested for: Java noob - help setting up eclipse

Replies
2
Views
425
  • Last Post
Replies
8
Views
278
  • Last Post
Replies
1
Views
466
  • Last Post
Replies
5
Views
609
Replies
2
Views
477
Replies
16
Views
963
Replies
15
Views
353
  • Last Post
2
Replies
51
Views
2K
Replies
0
Views
432
Top