?
Solved

Running/Compiling *.java (Java 5.0) file in Oracle Sql Devleloper

Posted on 2007-03-27
12
Medium Priority
?
1,392 Views
Last Modified: 2013-12-12
I have installed Oracle Sql Developer 1.1.2.25.70 with Java Platform 1.5.0_10 on Fedora 5.

Is it possible to compile and run a *.java file without connecting the Oracle Sql Developer to a database?

If it is possible how do i do this?
0
Comment
Question by:gram77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 20

Expert Comment

by:gatorvip
ID: 18800067
I don't really understand your question. You want to compile a .java file in SQL Dev? That's not what the app is for...  Also, SQL Dev doesn't come with the JDK, just the JRE.
0
 

Author Comment

by:gram77
ID: 18800093
So you mean you can't develop java applications in Oracle Sql Developer.

Oracle Sql Developer needs JDK preinstalled. before installing Sql Developer.
0
 

Author Comment

by:gram77
ID: 18800101
However, Sql Developer is able to understand all Java Keywords correctly as it prints them i blue..
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 20

Accepted Solution

by:
gatorvip earned 2000 total points
ID: 18800239
If you have the JDK preinstalled, you don't *need* SQL Developer to compile .java files. You can use notepad for that, in the worst case. SQL Developer is to be used for database development, running queries, etc.

http://www.oracle.com/technology/products/database/sql_developer/index.html

***
 Oracle SQL Developer is a free graphical tool for database development. With SQL Developer, you can browse database objects, run SQL statements and SQL scripts, and edit and debug PL/SQL statements. You can also run any number of provided reports, as well as create and save your own. SQL Developer enhances productivity and simplifies your database development tasks.
****

However, if you *really* want to use SQL Dev for java compilation, you can customize behavior under Tools/Preferences.
- Tools/External Tools/New then enter the path to the javac.exe compiler you want to use
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18800250
You can definitely customize SQL Dev to recognize keywords, Tools/Preferences/Code Editor/Syntax Colors
0
 

Author Comment

by:gram77
ID: 18800574
gatorvip:

I addes javac as an external tool.

It shows in the Tools menu as well as the context menu on right clicking.

It compiles the java program well.

However, when i run the .java program, it raises the error:

"The target cannot be started because there is no active project"
0
 

Author Comment

by:gram77
ID: 18800748
well i have added java i.e.
/usr/java/jre1.5.0_10/bin/java as an external tool too.

However, when i run Writer2.java class file, i get the following error.
/usr/java/jre1.5.0_10/bin/java /mnt/win/linux_bkup/scripts/java/Writer2
Exception in thread "main" java.lang.NoClassDefFoundError: /mnt/win/linux_bkup/scripts/java/Writer2

/usr/java/jre1.5.0_10/bin/java Writer2
Exception in thread "main" java.lang.NoClassDefFoundError: /mnt/win/linux_bkup/scripts/java/Writer2
0
 

Author Comment

by:gram77
ID: 18800778
However, in Fedora Terminal Window, i get the desired result:
[root@localhost java]# /usr/java/jre1.5.0_10/bin/java Writer2
12
howdy
folks
0
 
LVL 20

Assisted Solution

by:gatorvip
gatorvip earned 2000 total points
ID: 18801601
you will have to modify your classpath for your executables to work
0
 

Author Comment

by:gram77
ID: 18801803
gatorvip:
Modify the classpath in Fedora or Sql Developer.
You mean i should change the classpath in Sql Developer to the resemble classpath in Fedora?
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18802966
well, you can use it as a parameter directly in SQL Dev:

java -cp <your_classpath> (don't forget to include the current directory ".")
0
 

Author Comment

by:gram77
ID: 18813422
gatovip:
Wow! i am able to work on java using Oracle Sql Developer.

I am able to compile and run java source files :)

Many Thanks.
0

Featured Post

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question