Java noob - help setting up eclipse

  • Context: Java 
  • Thread starter Thread starter Hercuflea
  • Start date Start date
  • Tags Tags
    Eclipse Java Noob
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting issues with setting up Eclipse and Java JDK for a physics project. Participants share their experiences and seek solutions for a specific error encountered when attempting to run Java code.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant describes an error when trying to run their Java code in Eclipse, indicating that the code compiles without issues but fails to execute due to a missing class.
  • Another participant questions whether the code can be compiled and run from a shell, suggesting that the issue may be related to the project setup in Eclipse.
  • A participant mentions that the code ran successfully at school, indicating a potential configuration issue on their local machine.
  • One reply suggests that the participant may have selected the wrong project type in Eclipse and recommends using a Java Project instead of other types.
  • Another participant advises against using Eclipse EE, suggesting that Eclipse Classic or Eclipse for Java Developers would be more appropriate.
  • One participant expresses uncertainty about the installation process and lists steps they believe may be necessary for proper setup.
  • A suggestion is made to uninstall and retry the installation of Eclipse if issues persist.
  • Another participant asks if the user has been able to compile any other Java program, probing for additional context.
  • One reply emphasizes the importance of installing the JDK first and ensuring that Eclipse recognizes the installed Java version.

Areas of Agreement / Disagreement

Participants express varying opinions on the correct setup process and project type in Eclipse, indicating that multiple competing views remain regarding the best approach to resolve the issue.

Contextual Notes

Participants mention potential dependencies and project configurations that may not have been satisfied, as well as the importance of ensuring the correct version of Java is installed. There is also uncertainty about the installation steps and the appropriate version of Eclipse to use.

Who May Find This Useful

Individuals new to Java programming or Eclipse, particularly those working on academic projects or seeking to troubleshoot similar setup issues.

Hercuflea
Messages
593
Reaction score
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.
 
Technology news on Phys.org
Hercuflea said:
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?
 
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: 569
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.
 
coalquay404 said:
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.
 
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.
 
Here is a youtube video that shows how to install Eclipse on Windows:
 
Last edited by a moderator:
Have you been able to compile any other Java program, or is this the first one?
 
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
3K
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K