My Eclipse Installation has no Java options or connections - java

I am a new "programmer," and I've created a couple of very basic programs and so much of the terminology is very new to me. I wish to create an executable program from eclipse that I can use outside of eclipse and give a couple of other people for a project, and all of the tutorials said that I needed to use Java to create a .Jar program. The problem is that my version of Eclipse doesn't seem to have any options for working with Java. When I export, there is no option to export to Java. I have no option to create a new Java project either. I don't know the correct terminology, but it seems that my version of Eclipse is not connected to Java. Did I mess up somewhere along the line when installing Eclipse? Was there an option I failed to check? Any help would be appreciated! Thank you!

Related

Eclipse Application to standalone?

I have been using Eclipse for my Java needs for quite some time now, but I have never really delved deep into it.
I was recently given this project by a friend which makes use of the XText plugin library to act as an IDE for a custom file type.
However, to launch it, I need to open the source of the editor itself in Eclipse and run it as an Eclipse Application which in turns open a separate Eclipse IDE.
I have been looking around for an easy way around this, but to no avail. Is there a way to run said Eclipse Application without having to first open the source of the custom editor and launching it?
Thank you!
I solved it by creating a shortcut for Eclipse and adding -data "PATH_TO_APP" on the 'target' field.
Thank you for your help everyone. :)

Automatically run Java app after installation (Mac)

Apologies if this has been asked already and I've missed it.
I'm writing a JavaFX desktop app, and would like to make it automatically run after installation, but I'm not sure where to look to make this happen (or even if it's possible?). I have successfully created a .dmg installer using E(fx)clipse & Ant. Are there options I'm overlooking which I can use in the build.xml? or am I looking in the wrong place entirely?
Thanks in advance :)

How do you use a Java project in your Android project in Eclipse?

I'm writing an Android application and there's some Java code in it that's somewhat sophisticated and therefore hard to verify the correctness of in the Android environment. I would like to run this code in a desktop environment where I have more tools with which to examine the output of this code while still using it in my Android application.
My attempted solution is to have three different projects in Eclipse. My Android project and two plain (non-Android) Java projects. One Java project has the sophisticated code that I want to use in Android and the other is a test program that verifies the correctness of the former project. The latter project has already been useful in debugging the former.
However, so far, my attempts to use the Java project in my Android project appears to work in the IDE but when I actually run the Android application, the NoClassDefFoundError exception is thrown whenever I try to access any of the classes. Obviously, that code is not being recompiled into the .dex file but why not?
I could go into detail about what I've done so far but I can't help but think that what I'm doing is a pretty standard and simple thing and there's a plain way of doing it, even though I can't find anyone doing quite what I'm trying. Can someone describe to me how this is done?
Luckily, I found the answer to my own question and I thought I'd share it here to help others in the same situation. It turned out to be very simple...
What I was already doing would have normally worked, which should have been a big clue to me since I have actually done this before, successfully. All you have to do is, under your Android project's Properties > Java Build Path > Projects, add the plain Java project to your "Required projects on the build path" and then under Properties > Java Build Path > Order and Export, check the checkbox of that same project in the "Build class path order and exported entries" list and everything should just work.
From within Eclipse, there's nothing else you need to do to get this setup to work. It's only when you're compiling from the command line that you need to build Java Jars and import them as libraries but I'm not doing that (yet).
Finally, this wasn't working for me because I just happened to be compiling my plain Java project under JDK 1.7 compliance, while my Android project was compiled under JDK 1.6. This is verified by the output on the Console pane, reporting "Dx bad class file magic (cafebabe) or version." This error message goes away when both projects are compiled under the same compliance level and, not coincidentally, the Android program runs properly.
Thank you to everyone who tried to help and I hope this answer is helpful to someone out there!
Would it not work if you made your other plain java project into an Android project and use it to monitor the output on the device?

Thinking in java library installation

Hi i've been trying to install the library on Thinking in Java book 4th edition and i hit a very thick brick wall. I've done everything that the guide from the website told me to do and i still can't get the library to work. From what i've read it seems that the problem is from the build.xml files. having no xml knowledge I am clueless about how I have to modify it in order for it to work. In both cmd and eclipse I am getting these error
c:\TIJ4\code\build.xml
Build Failed
c:\TIJ4\code\build.xml:59:J2SE5 required
Can anyone tell me what I should do ?
I am using eclipse if there is a simpler solution by using eclipse rather than ant please help me out. It's been a week now and I still can't make it work.
The important thing to do is to realize that your ant file has a specific java requirement.
Something to try that might fix this very easily : I believe you can remove any references to a specific JDK, and if you have a reasonably up to date JDK, the build will succeed.
The definete fix : Look into the exact (line 59) of your build file, and try to satisfy the java version that line requires. Java is generally backwords compatible -- something designed to run in J2SE5 should run in the latest JDK. Its not terribly difficult to update your JDK (just google for instructions on your OS).
The most common mistake I see is that people who have the java run time installed believe they also have the Java SDK as well.
Does this "install the library" means you want to look at the code and run them in your eclipse? If so I can share my experience with you.
First run the Eclipse.py script; this will add package info to the source code
Create a new Java project in Eclipse, and then just copy all the source code folders to the src source folder in eclipse, these folders will then be recognized as Java packages.
You should be able to run the classes with a main function.
You can also configure which java version to use for this project in Eclipse build path. 1.5 or higher will work.

Java makefile to eclipse project

I have an makefile version of a java project which is organized as follows:
CLASSFILES=Main/Main.class Lex/BooleanLiteral.class< and so on>
JAVAFILES=IR/*.java
CFILES=Runtime/*.c
I am looking to move this to Eclipse so that I would be able to debug it better( I need to implement a feature in this codebase and i need to understand the codeflow better. )
I am a C++ programmer and I have just moved to Java programming, i have tried to follow the instructions in this link
How do I import a pre-existing Java project into Eclipse and get up and running?
but i am getting the following error, the project was not built since its build path is not complete. I am really stuck here, any help would be much appreciated.
Regards,
Subramanian

Categories