Xcode and older Java projects
Help!
Recently I've tried to re-run some older Java Xcode projects and have received this error message:
"Jam is deprecated and has been removed; targets that use Jam must be upgraded to native targets. For more information on doing this, consult the Xcode documentation."
I can get around the problem by copying the old code into a newly created project; however, when I tried to follow the instruction in the error message and consult the Xcode documentation, I could find no information on how to do this. I have tried searching the user docs for all of the terms in the above message with no useful results. Selecting "Upgrade all targets to native" from the Project menu produces a warning that this is not supported in Java.
I must be missing something really obvious. Can anybody tell me what is going on?
Thanks, dcl
Thanks for the quick reply, Karl.
I should have mentioned that I'm pretty much a beginner with Xcode and Java (actually, with software in general). I get the impression that you don't think that Xcode is a very good way to develop Java. Why is that?
For my level of programming it works just fine (usually). If I start with a new project there is no problem; however, I can't go back and work on older projects because of the problem I mentioned in the original email.
Any clues as to what is going on?
Similar Messages
-
XCode Java project: can't add files
Greetings all,
I have a Java codebase which I developed in JBuilder. I now want to produce the final product, a Mac app. To do this I fired up my XCode 2.5. I went File->New Project and chose Java Application under the Java template group.
Since I don't want the three .java files that the template helpfully puts into the project, I removed them. (The only way to do this seems to be to close the project, go to the Finder, and delete them there, then re-open the project...whatever...) My next task was obviously to add my java files and the three .jar files that they depend on.
Which is where I ran into problems. It doesn't seem to matter what I do, I cannot get my files properly added to the project.
I have tried dragging the files from the Finder into the XCode project window and dropping them on the src group icon; despite the fact that the disclosure triangle to the left of the group flashes a lovely shade of pink and then self-opens, when I drop the files there, they do NOT get put into the group; they become siblings of the group instead.
I have tried right-clicking on the group and choosing Add->Existing Files; same result as above.
I have tried single-clicking on the group and choosing Project->Add to Project from the menu bar; same result as above.
I should mention that in all of these three, I do get asked whether I want to copy the file or just have a reference created to it; I always choose not to copy the file (since I want my files to live elsewhere). However, just to experiment, I have just tried Project->Add to Project and asked for the chosen file to be copied...same result as above. The file ends up a sibling of the src group.
I have also tried removing the src group from the project window and then dragging in from the Finder the entire src folder which holds my Java codebase. It successfully arrives in the project window, but its colour is yellow (whereas the original one's colour was blue) and it never gets compiled. I can't seem to convince XCode that these files are source and should be compiled...despite the fact that if I get out the Info window on any of them, the FileType popup menu states that they are "sourcecode.java".
I have even tried making an alias to the src folder which holds the codebase, and moving this alias into the XCode project directory in the Finder. This fails to build since XCode tells me that it can't create the directory "src" since one already exists with that name!
The only way I have found which has any success at all is to actually copy the files and folders into the src and lib folders of the XCode project directory, in the Finder. However, this is not acceptable for either the java or the .jar files. The java files need to be in a certain location for JBuilder, and the .jar files are common files and I am not at all interested in having multiple copies of them floating around on my disk! Furthermore this sort of behaviour should not be necessary with a modern compilation system, especially not one created by Apple.
Please, can some kind soul tell me, how on earth am I supposed to add existing files to an XCode Java application project, without putting them into the project directory on the disk?
Thanks gratefully in advance!Hi SkiAddict1
I can't speak for Xcode 2.5, only 3.1...
The way to add new Java source files is to highlight one of the existing source files (in the src group) and then use File > New File...
If you want to create a package hierarchy, then you need to use Finder to create the corresponding folders inside src. Once you've done this, then you can create a source file inside a package by highlighting any Java source file, then selecting File > New File... then using the Choose option to specify the correct location. At this point, the main project window doesn't show the newly created file in the folder hierarchy, however next time you restart Xcode it will appear in the right place.
I think the issue is that the designers of Xcode didn't adequately cater for the Ant tool's use of a src folder and the requirement for nested folders to represent a package hierarchy. However, it's still possible to make do provided you create the folders yourself and always remember to highlight an existing source file before creating a new file.
Bob
PS: A neat trick which I find quite handy when porting an existing Java program is to use the boilerplate main class which Xcode creates and use it to call the main () method of the imported project. Eg:
public class ProjectName {
public static void main (String [] args) {
// Call the main method of the imported project
com.company.project.ProjectClass.main (args);
} -
File access in a Java project under XCode
Hello again,
I have had another issue: I'm trying to have one of my classes read information from an XML file, whose location is in the same folder as the classes and, indeed, the project (and the .xcodeproj file).
So I give the file's name to the method, but it cannot seem to find the file where I put it; instead, it looks for it in (Project folder)/Build/Debug/.
What should I do? I do not feel it wise to put it into Build/Debug as it is a file that should be deployed along with the rest of the application (when I learn how to make one, that is), but after a little searching around I'm a bit at a loss about that.
Thanks in advance,This option is normally used for storing preference
files. If you have a number of files then you can
create a folder to hold them. If you have a look
around at the files which are already there (for
other applications) you'll get the idea.
Well, preference files are fine but I don't view them as useful for data.
This folder
is strictly OS X only, but I'll explain there's a way
around that later on.
I failed to catch that explanation, but you might want to leave it at that. No high priority as far as I'm concerned. (Of course, it could be of interest to anyone who finds this discussion - why else are we using a forum, right?)
You can create a bundle from a Java program using
Macintosh HD/Developer/Applications/Java Tools/Jar
Bunder. Again, this is OS X only.
Again, good to know, but not usable now by this developer.
If your program relies on a number files (for example
jpg files for graphics and wav files for sounds) then
these can be added to the jar file. Xcode will do
this for you if you add the file to the project, then
drag it onto the Build Java Resources build phase.
This form of words will extract the file called
stars.jpg from the jar file:
URL f = getClass ().getResource ("stars.jpg");
image = ImageIO.read (f);
Interesting, but the software I'm using as a model of sorts (as far as general design goes from a user point of view) seems to have little in the jar file besides classes. I'd like sufficiently advanced users to be able to access the data files directly (I'll make them nice XML files) but not get into the .jar. Tell you what, I just stumbled on the XML reading class and it seems to be using File.getAbsolutePath(). I must try this.
This works on all Java platforms and so is often
used. There is a standard Unix/Terminal command
called jar which gives you fine control over a jar
file. Type man jar in Terminal for details and more
info about jar files.
Thanks.
6) You think you never mentioned a sixth option?
Well, you did - in that other topic you answered.
You
gave me the idea of fiddling with project
settings.
Be aflaid, be vely aflaid! I have tried to use
$(PROJECT_DIR) instead of $(inherited) in "Build
Products Path" and "Per-configuration Build
Products
Path", but so far to no avail: running throws a
"LaunchRunner Error" = "The main class
"Main_Class"
could not be found."
These are Xcode options and probably won't be of much
value to you.
Well, they are. But I suddenly realize it may work fine and well while in debug, but not so well once everything is compiled and set into a nice application. I'll try this.
BTW. Did you know that a Java program can find out
which platform it's running on? Just call String
opSys = System.getProperty ("os.name");
This enables you to use different solutions for each
different platform.
Actually, I knew about System.getProperty. I've been trying to use it to imitate the Application.Path property from Visual Basic (the language I use most at work), that returns the current location of the application. Does there exist something like that in Java? I've tried System.getProperty with "user.dir", "java.home" and "java.class.path", to no avail: the first gives me Build/Debug (or Build/Release, depending on the build configuration), the second returns the place where you can find Java, in the System/Library structure, and the third yields a looooong path list.
(Still, might be onto something with that File.getAbsolutePath() thingie. I really have to try it.)
Thanks again for the elaboration, helpful as usual and rightly clicked so.
iMac Mac OS X (10.4.8) -
Create a new Java project in xcode??
I wanto kno if I need to install any additional stuff so I can create java projects in xcode, because when I create a new project java doesent appear in the window, the only types I can create are projects for iphone and Mac OS X but I cant find any java project or even compile a Java file when I open it with Xcode
You should post your quesiton in the Developer forums:
http://discussions.apple.com/category.jspa?categoryID=164 -
First Java Project - Document Management and Workflow
We are about to embark on our first java project around document management and workflow.
I would be interested to know how others have approached similar projects – Open Source applications or other tools/APIs.
It would also be good to know of any issues encountered along the way.
Thanks,
SteveHi Husein,
I appreciate your interest in procuring a Document Management/Workflow solution for your AP department...its a very smart move toward streamling that process!
I sent an email today to Richard Braddock about our solutions. I would be happy to discuss them with you.
My office phone number is 215-646-8000
-Martin -
I have recently started a solaris. I have a solaris using 64x and 86x systems and have java. The machine is very active and is very quick. I am happy so far with its performance and think its worthwhile to continue with my projects. That's all I have to say.
John LuptonI have recently started a solaris. I have a solaris using 64x and 86x systems and have java. The machine is very active and is very quick. I am happy so far with its performance and think its worthwhile to continue with my projects. That's all I have to say.
John Lupton -
Packaging and installing a java project
Hi everyone,
I have a java project which has been developed in Eclipse IDE. I would like to package the project so that i it can be installed and can be run as a stand alone product.
Any tools that would help me do packaging and installing a java project?
Thank you.Easiest way to package a Java project is to create an executable jar for it. You probably should google for more information on the 'jar.exe' program (sry for window bias)
If you have external dependencies you should put those in separate jars and include them in the classpath in the jar manifest file.
The only other thing to worry about is getting java installed on other people's machines. In general it is best if possible to have them download java themselves as they will get the latest and greatest from this website. If that's not possible you may want to look into getting sun's permission to distribute Java with your app. -
Working on first Java project in Ecplise and need some help
I am working on a Java project. I am working a programme to show sets of requirements to a software engineer. At the end the programme will show all consistent requirements with no conflicts between them.
I am working on the first section. This invloves creating a class with a HashSet to insert the requirements in to the class. I am using this code at the moment
import java.util.HashSet;
import java.util.Set;
public class requirements {
public void HashSet() {
Set<String> requirements = new HashSet<String>();
//Declare some string items
String item_1 = "r1";
String item_2 = "r2";
String item_3 = "r3";
boolean result;
//Add the items to the Set
result = requirements.add(item_1);
System.out.println(item_1 + ": " + result);
result = requirements.add(item_2);
System.out.println(item_2 + ": " + result);
result = requirements.add(item_3);
System.out.println(item_3 + ": " + result);
//Now we try to add item_1 again
result = requirements.add(item_1);
System.out.println(item_1 + ": " + result);
//Adding null
result = requirements.add(null);
System.out.println("null: " + result);
//Adding null again
result = requirements.add(null);
System.out.println("null: " + result);
public static void main(String[] args) {
new requirements().HashSet();
the class is called requirements and I get these errors
Return type of the method is missing
Syntax error on token class, delete this token
Syntax error on token misplaced construct
Syntax error insert Enum body to complete EnumheaderName
Syntax Error insert Enum body to complete enum decleration
The public type requirements must be defined in its own file.
The next stage would be to send the Hashset to another class to perform operation on the set. The other class is called specification. Can anyone help me to resolve the errors and pass the set to the other class.
Thanksmuj wrote:
I am working on a Java project. I am working a programme to show sets of requirements to a software engineer. At the end the programme will show all consistent requirements with no conflicts between them.
I am working on the first section. This invloves creating a class with a HashSet to insert the requirements in to the class. I am using this code at the moment
import java.util.HashSet;
import java.util.Set;
public class requirements {
public void HashSet() {
Set<String> requirements = new HashSet<String>();
//Declare some string items
String item_1 = "r1";
String item_2 = "r2";
String item_3 = "r3";
boolean result;
//Add the items to the Set
result = requirements.add(item_1);
System.out.println(item_1 + ": " + result);
result = requirements.add(item_2);
System.out.println(item_2 + ": " + result);
result = requirements.add(item_3);
System.out.println(item_3 + ": " + result);
//Now we try to add item_1 again
result = requirements.add(item_1);
System.out.println(item_1 + ": " + result);
//Adding null
result = requirements.add(null);
System.out.println("null: " + result);
//Adding null again
result = requirements.add(null);
System.out.println("null: " + result);
public static void main(String[] args) {
new requirements().HashSet();
the class is called requirements and I get these errors
Return type of the method is missing
Syntax error on token class, delete this token
Syntax error on token misplaced construct
Syntax error insert Enum body to complete EnumheaderName
Syntax Error insert Enum body to complete enum decleration
The public type requirements must be defined in its own file.
The next stage would be to send the Hashset to another class to perform operation on the set. The other class is called specification. Can anyone help me to resolve the errors and pass the set to the other class.
ThanksReading your code, it looks wrong... but it turns out that a lot of it was because you did not use CODE brackets like this:
{+code}
System.out.println("hello");
{code+}
becomes
System.out.println("hello");It also seems that you code works as it is.
though I recommend putting classes inside a package.
Syntax error insert Enum body to complete EnumheaderNameWhere is this even in your code? Did you post the code you had a problem with? -
IDVD6 and iPhoto6 installation rendered older iDVD projects useless
Had some iDVD5 projects in progress and then installed iLife6. Can't open the older iDVD projects with iDVD6, all iPhotos are missing and the system does not seem to be able to find them again. This is because the file stucture of iPhoto6 is different from the one in iPhoto5.
Worse, iDVD6 eventually hangs up and needs to be force-quit.
After this happens, iDVD6 always tries to open the old project, hangs up, etc. Deleting the preference file is the only option to get to iDVD6 again.
Does anybody have a solution? How can I use my older iDVD projects? How can I help iDVD6 to find the missing iPhoto files?
Dual G4 Mac OS X (10.4.4)Did you backup your iPhoto Library before upgrading?
If so, you can do some renaming to get iDVD to point to the 'old' iPhoto Library that has the structure that iDVD needs to access it. I am sorry that I cannot get the exact instructions to you right now...look in iPhoto for posts addressing this. The poster Old Toad has specific directions...he is one of iPhoto's gurus...and you will probably be able to get your photos into iDVD again.
See if this helps at all:
http://discussions.apple.com/thread.jspa?threadID=314273&tstart=350 -
Hi, I am a new user to xCode and just recently downloaded a SDK Disk image and also an older version of xCode from the Apple Developer site. I opened the 'Interface Builder' for the first time and it worked. Next, when I tried to open it again (with and without the xCode 'Mainmenu.xib' attachment file from xCode) it kept showing the message "it quit unexpectedly".
I need to create an application for a project I am working on. If anyone who can resolve my problem of why the Interface Builder is not working, that will be great.
If you need additional details (like which versions etc.) please ask, for I am desperate to find an adequate solution to this problem.
Thanks.If you need additional details (like which versions etc.) please ask, for I am desperate to find an adequate solution to this problem.
Without intending any disrespect, if you had suspected these would be questions and if you're in a hurry for an answer, then why did you exclude the information? And yes, knowing the Mac OS X version (preferably Mac OS X 10.5.8 or 10.6.7) , as well as the Xcode version might shed some light on this. Might. And I'll presume there's a specific reason you downloaded what I will assume is an Xcode3 version.
Was this an existing Xcode project, or did you start with a new project here? If it's an existing project, it could well have a corruption or an incompatibility.
Initially, I'd probably start with a new project, and load in newly-copied source files. On the off chance the project is corrupted.
Failing that, I'd deinstall Xcode using the documented procedures, and would then reload it. If there was an old version of Xcode around on the system, sometimes wonky stuff can happen with an installation.
And FWIW, the Apple Developer Forums and the Apple mailing lists tend to see far more developer-related traffic than do these particular forums. (There's an Xcode users' mailing list around which sees regular traffic, too.) -
How to use BO SDK in local java project?
Hi,
I am trying to connect BO system using below mentioned code
public void main(String args[]) throws SDKException {
try
System.out.println("main");
/ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();/
IEnterpriseSession boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( "Administrator","","BOSAP","secEnterprise");
IInfoStore boInfoStore =(IInfoStore) boEnterpriseSession.getService("InfoStore");
ChangePWD(boEnterpriseSession, boInfoStore);
}catch(Exception e)
System.out.println("Exceptions in main");
System.out.println(e);
This code was taken from below mentioned thread:
Force all users to change their Enterprise passwords with a batch operation
I have created standalone java project and running as JAVA application in eclipce. I am getting class def not found error for these BO SDK jar files. I have added
cecore.jar
celib.jar and
cesession.jar files as external lib to java project
I am using following imports
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.*;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.plugin.desktop.user.IUser;
Does any one know solution to fix class def not found error?
Thanks
Nitesh ShelarI did some mistake few dependent jars were missing in project build path. After adding those missing BO jar files. Now its giving server connection error. Which I am trying to resolve.
Thanks for your help.
Nitesh Shelar -
I m not able to create xml file in Java Project
hi all,
I have created one java project just to try with Ant Builder. I have created one class inside it. and now i m creating an XML file inside that project.
But as soon as i try to create the File -> New -> File and give the .xml extention of the file this gives error into the project.
Will you suggest me the solution for that?
Thanks in advance.Assuming that you are facing this problem in NDS, here is the solution.
Go to Windows--> Preferences --> WorkBench -->File Associations
In the File Types list select *.xml
This will display the default associated XML editor as
XML Editor(default) in the bottom list box.
Click on add button near the bottom list box and select Text Editor, click Ok.You will see one more entry in the list box as "Text Editor".
Select this entry and click on the default button.
Click Ok and close the preferences dialogue.
Now create a new xml file.You wont see the error this time.
Please note that this will treat all simple xml files you will create as TEXT Files and always open with Text Editor.You can override this behaviour with right click on the file and select appropriate editor from the "Open With" context menu.
The error you are talking about is because the XML editor tries to check well-formedness and basic syntax rules for the file that you newly created, actually is a noce feature of the IDE.
Rgds,
Amol -
Help Needed with Computer Science Java Project!
Hi everyone, im in my final year at uni, im implementing a board game in java. I've started programming it, but have the main part yet to do, which is the actual game play. I need someone to look at my code and give me a few pointers, or even better do it for me, all this of course after you read the game description and the project specification. Whoever maybe able to help please send me your email, and i will send you all that i have, i.e. the project proposal, game description, project specification, and the java files. Anyones help will be much appreciated and rewarded, i have only 3 - 4 weeks to complete this project and need to get a first for it. Therefore i need help urgently! You can email me at [email protected], many thanks!
MaceHi everyone, im in my final year at uni, im
implementing a board game in java. I've started
programming it, but have the main part yet to do,
which is the actual game play. So, you're in your final year, and yet you still think the correct approach is to just sit down and start writing code without first figuring out what the major pieces will be and how they'll fit together. You haven't learned much then.
I need someone to look
at my code and give me a few pointers, or even better
do it for me, Ah, you're one of those vile, disgusting, lowlife shitbuckets who thinks it's okay to take credit for others' work and phuck over your classmates in the process.
I mean this sincerely: I hope you die soon. Before you have the chance to breed. -
[ot] A UML tool for a new Java project
I am working on the new Java project and need a UML tool to get it start. I am wondering whether anyone one can recommend such tool or not. It can be either stand alone or as an Eclipse plug-in. It shall be able to handle at least 50 classes.
Thanks.Is it any good? I haven't tried it but we're
evaluating UML tools here and it's on my list to play
with.
PS.If you mean SDE....
I have only used the personal edition at home, and the other versions have more functionality available
My impressions, FWIW, are
- easier to use than rational rose (I find this one which I have to use at work to be a pain), although, paradoxically enough, they are not that dissimilar in appearance
- I was able to create some reasonably complex models without any problems
- easy to install and start using - no great learning curve
- I tried importing a model I had exported from rose and that did not work very well at all.
- this applies to version 2.2 -
Best Practices for Defining NDS Java Projects...
We are doing a Proof of Concept on using NDS to develop non-SAP Java applications. We are attempting to determine if we can replace our current Java development tools with NDS/WAS.
We are struggling with SAP's terminology and "plumbing" for setting up/defining Java projects. For example, what is and when do you define Tracks, Software Components, Development Components, etc. All of these terms are totally foreign to us and do not relate to our current Java environment (at least not that we can see). We are also struggling with how the DTR and activities tie in to those components.
If any one has defined best practices for setting up Java projects or has struggled with and overcome these same issues, please provide us with some guidance. This is a very frustrating and time-consuming issue for us.
Thank you!!Hi Peggy,
In Component Model we divide software projects into small components.Components can use other components in well defined manner.
A development object is a part of a component that can be changed or developed in some way; it provides the component with a certain part of its functionality. A development object may be a Java class, a Web Dynpro view, a table definition, a JSP page, and so on. Development objects are always stored as sources in a repository.
A development component can be defined as a frame shared by a number of objects, which are part of the software.
Software components combine components (DCs) to larger units for delivery and deployment.
A track comprises configurations and runtime systems required for developing software component versions.It ensures stable states of deliverables used by subsequent tracks.
The Design Time Repository is for versioning source code management. Distributed development of software in teams. Transport and replication of sources.
You can also find lot of support in SDN for the above concepts with tutorials.
Refer this Link for a overview on Java development Infrastructure(JDI)
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/java development infrastructure jdi overview.pdf
To understand further
Working with Net Weaver Development Infrastructure :
http://help.sap.com/saphelp_nw04/helpdata/en/03/f6bc3d42f46c33e10000000a11405a/content.htm
In the above link you can find all the concepts clearly explained.You can also find the required tutorials for development.
Regards,
Vijith
Maybe you are looking for
-
Deletion of filter components from Bex Report in BI 7.0 via back end.
Hi, I want to delete 2 filter field components from the BI 7.0 report via back end. Im using the Tcode RSZDELETE and giving the variable element UID, Inforprovide name, query tech name. But when i excute it says empty selection. Other than this is th
-
Downloding from internal table to excel
Hi All, I am using ole concept to download data from internal table to excel because i want to fill few records with colors and few with bold etc. But this ole concept is downloading to excel line by line and taking much time. How can i improve the p
-
There is more computing power in even a basic mobile than was used to put man on the moon (they mostly used slide rules). It occurs to me that they could be put to use in a variety of applications as remote controlling or monitoring devices. Indeed,
-
My view of emails has changed suddenly to only one line. It used to be a bigger window, allowing me to read part of the body of the email, while viewing all new emails....how can I get that view back? Is that a long header? I try to click on long
-
Path changed in Executable, screenshot impossible
Hello everybody, I have a program, which save a screenhot of the current VI. If I create a executable the "save a screenhot of the current VI" doesn't work. Maybe there is a problem with the file directory? I attempted it with the File constant: curr