Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:50:04+00:00 2026-06-14T02:50:04+00:00

According to Orcale’s Java7 assert guide : source mode 1.3 (default) — the compiler

  • 0

According to Orcale’s Java7 assert guide:

  • source mode 1.3 (default) — the compiler accepts programs that use assert as an identifier, but issues warnings. In this mode, programs are not permitted to use the assert statement.
  • source mode 1.4 — the compiler generates an error message if the program uses assert as an identifier. In this mode, programs are permitted to use the assert statement.

I wrote such class:

package mm;

public class ClassTest {
    public static void main(String[] arg) {
        int assert = 1;
        System.out.println(assert);
    }
}

It should compile fine if Oracle’s info right (1.3 is default source mode). But I got errors like this:

$ javac -version
javac 1.7.0_04

$ javac -d bin src/mm/*
src\mm\ClassTest.java:5: error: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier
                int assert = 1;
                    ^
  (use -source 1.3 or lower to use 'assert' as an identifier)
src\mm\ClassTest.java:6: error: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier
                System.out.println(assert);
                                   ^
  (use -source 1.3 or lower to use 'assert' as an identifier)
2 errors

I added manually -source 1.3 and it issued warnings but compiled fine. It seems that Oracle’s information is wrong and 1.3 is not default source mode. Which one is it then?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:50:05+00:00Added an answer on June 14, 2026 at 2:50 am

    In Java 7, the default source mode is 1.7 according to Oracle’s doc (see the -source option).
    The doc you’re referring to probably needs to be updated

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According MSDN, FxCop is an application that analyzes managed code assemblies (code that targets
According to Hibernate documentation : After observing that arrays cannot be lazy , you
How could that be that TransformerFactory.newInstance().newTransformer(streamSource) returns null. According to javadoc this is not
According to one of my posts (below) it seems that there is no such
According to http://www.orafaq.com/node/855 The record in that table for Incomplete Join Trail Wrong way
According to this Oracle document , it seems that for Windows Server 2008 R2,
According to my previous question integration of jsf2.0 and spring 3.1 and hibernate 4.1
According to the C++11 standard, is the following program well-formed and portable C++? int
According to this SO post: How to check the TEMPLATE_DEBUG flag in a django
According to PHP.net manual, pg_pconnect will create a persistent connection, or will return the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.