Quillz Posted November 21, 2009 Share Posted November 21, 2009 A while ago I made a topic about wanting to compile and run Java programs with a text editor. I was using TextMate for a while, but ending up switching to BBEdit. It does the job, but I can't figure out how to compile and run the Java programs I write. This is what I get: I'm not sure what a "shebang" is. Link to comment Share on other sites More sharing options...
+Frank B. Subscriber² Posted November 21, 2009 Subscriber² Share Posted November 21, 2009 http://en.wikipedia.org/wiki/Shebang_%28Unix%29 It looks like it's trying to invoke some kind of bash script which is lacking a line like #!/bin/bash or similar. Link to comment Share on other sites More sharing options...
Quillz Posted November 21, 2009 Author Share Posted November 21, 2009 http://en.wikipedia.org/wiki/Shebang_%28Unix%29It looks like it's trying to invoke some kind of bash script which is lacking a line like #!/bin/bash or similar. Hmm... All I'm testing is a basic Java program... #!/bin/bash public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } } This will let me run the Terminal, but then I get this: Link to comment Share on other sites More sharing options...
Elliott Posted November 23, 2009 Share Posted November 23, 2009 I don't think BBEdit will do a compile and run for Java. It just tries to run it like a shell script (and never compiling it), which is why it thinks it needs a shebang. Edit: Found this: http://nanotux.com/blog/bbedit-java-compiler/. Might help. Link to comment Share on other sites More sharing options...
Rudy Posted November 23, 2009 Share Posted November 23, 2009 Hmm... All I'm testing is a basic Java program... #!/bin/bash public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } } This will let me run the Terminal, but then I get this: I've never seen a java program start with #!/bin/bash...... that's for bash scripts... Link to comment Share on other sites More sharing options...
Elliott Posted November 23, 2009 Share Posted November 23, 2009 I've never seen a java program start with #!/bin/bash...... that's for bash scripts... Yea, a Java program would never need the shebang. It's just that BBEdit's "Run" command just tries to run whatever you've made as a shell script and not use the specific method of whatever language you're writing in. Link to comment Share on other sites More sharing options...
Recommended Posts