Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
i've installed xcode on my powerbook
and i imported some java files from my pc
i tried opening and running two .java files
it opens them but i can't run them
i can't build and run the project
i can't run a .jar file i've made using jbuilder on my pc
also,i can't see the applet itself on a test web page i created
do i need to set something else up or install extra packages?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
OK. Lets try and find out what you have done.

You started XCode and started a new project and chose what as the type of project?

When you say you tried to run .java file what do you mean? .java files are source files and cannot be executed. .class files can be executed if the source .java file defines a main method.

How are you trying to run the jar file? Double clicking on it? From the command line?
 

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
i double clicked on the .java files and they opened with xcode
i had two files open and i tried to build (compile and run)
but the option was greyed out
i double clicked on the .jar file to run it but nothing happened
i double click it on my pc and it works just fine
 

Peace

Cancelled
Apr 1, 2005
19,546
4,557
Space The Only Frontier
It all depends on what version of XCode and Java is being used..

I might also add that Microsofts Java is not compliant with Suns..

OS X uses Sun Java
It's likely your java app was compiled using a different platform and wont compile under OS X without some code changes.
 

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
ok,it runs from the terminal with javac and java fine

when i double click on the .java files it opens them with xcode (2.1)
it opens them but the build options (as most options) are still greyed out
i think i've got java 1.5 so it should work
don't understand why it doesn't
 

Edot

macrumors 6502
Jan 29, 2002
432
0
NJ
I am guessing you are opening the .java files from the finder via double click. If you want to build a java app in xcode I would guess you need to create a java project via File>New Project in xcode, then import your source files and build.
 

Thomas Harte

macrumors 6502
Nov 30, 2005
400
4
What steps did you take to import the Java into your project? And have you considered less frequent use of the enter button?
 

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
i didn't use the enter button,i have a wireless mouse and i double clicked on the files
opened them both and tried to build
didn't work
i also tried creating a project with xcode and opened and re-saved the files as .java and still couldn't build
any proper help?
i can make jokes about over using buttons and such too but i need some real help and not critisism
thanks
 

cazlar

macrumors 6502
Oct 2, 2003
492
11
Sydney, Australia
sk3pt1c said:
i also tried creating a project with xcode and opened and re-saved the files as .java and still couldn't build

I've not used java for awhile, but I think you don't want to be opening the files in this way, you want to add them to your project via the "Project/Add to Project..." menu item. It will then add them to the source list on the left pane.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.