Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

drjava AND how to change compiler version?

 
armeen golden
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have been using drjava for a while and i am pretty happy with its interface and overall preformance. drjava compiler is using verstion 1.4.x however i would like to change that to 1.5 which is installed on my machine.

i am writing codes that takes advantage of new classes in 1.5 and it does not compile via drjava (compiler v.1.4.x) however through terminal which is set to compile via 1.5 version, those codes compile and work just fine!

i looked at drjava preferneces but i see no options to change the compiler version? by the way i am using mac os x tiger, drjava version 20050814-223.

thanks for your help in advance.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Editing the Config File

Rene
 
armeen golden
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the link. i am not able to find any confugration file in the home directory. the only file available is the drjava.plist which is located in home/library/prefereces/

any other inspiring ideas?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just downloaded 'drjava-stable-20050814-2234' and started the App 'DrJava.app' - closed it again - and I got a '.drjava' file in my home dir.

My default java version is 1.5 !!

Therefore I then modified the '.drjava' file as described in the user guide.
added this line: 'javac.location=/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Classes/classes.jar'

I then reopened 'DrJava.app' - and I got both Compiler 1.4.x and 1.5.0

You should also be able to add the new java.location via the GUI under 'Resource Location->Tools.jar Location'

Rene
[ November 17, 2005: Message edited by: Rene Larsen ]
 
armeen golden
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright i came up with a solution. i was under the impression that spotlight searches for the hidden file as well. i used thinkertool utility to identify .drjava file which was located in my home directory. the instructions in the documentation is not very clears on how exactly change the compiler version!

instead, i used the java preferences utility located in /Applications/Utilities/Java/J2SE 5.0/. from there i just had to change the order of java verstions that appls used in my system. before it was set to 1.4.2 then 1.5. now the order is the other way around and everything is working great.
 
Scott Spencer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I've found that if I just set the Java Applet and Application Runtime settings to J2SE 5.0 in the Java Preferences.app in /Applications/Utilities/Java/J2SE 5.0, DrJava will use 5.0 on it's own.

However, this is interesting because I would love to use DrJava to compile LeJOS code, and if possible I'd like to get DrJava to include the LeJOS Compiler in the compiler list.

BTW, I love DrJava for a Java development IDE on the Mac. It is powerful yet easy to learn and use.

http://drjava.org/
[ December 02, 2005: Message edited by: Scott Spencer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic