Solved

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

Posted on 2007-03-27
12
1,277 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Accepted Solution

by:
gatorvip earned 500 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 500 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

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.

Question has a verified solution.

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

Suggested Solutions

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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